summaryrefslogtreecommitdiff
path: root/gnu/lib/libg++
diff options
context:
space:
mode:
authormycroft <mycroft@NetBSD.org>1995-03-01 00:00:00 +0000
committermycroft <mycroft@NetBSD.org>1995-03-01 00:00:00 +0000
commit4c34be6b52a699cc7287e3b937a69ca90fd2ced9 (patch)
tree0b0c2cc7c7d71419513e6302a3adf0b1829bf333 /gnu/lib/libg++
parent5c42185b5c628c038e11439c03ffcad1b27f6ec5 (diff)
Clean up deleted files.
Diffstat (limited to 'gnu/lib/libg++')
-rw-r--r--gnu/lib/libg++/g++-include/CursesW.h397
-rw-r--r--gnu/lib/libg++/g++-include/DiscUnif.h79
-rw-r--r--gnu/lib/libg++/g++-include/Erlang.h77
-rw-r--r--gnu/lib/libg++/g++-include/File.h302
-rw-r--r--gnu/lib/libg++/g++-include/Filebuf.h32
-rw-r--r--gnu/lib/libg++/g++-include/Fix.h468
-rw-r--r--gnu/lib/libg++/g++-include/Fix16.h647
-rw-r--r--gnu/lib/libg++/g++-include/Fix24.h595
-rw-r--r--gnu/lib/libg++/g++-include/Fmodes.h34
-rw-r--r--gnu/lib/libg++/g++-include/Geom.h59
-rw-r--r--gnu/lib/libg++/g++-include/GetOpt.h131
-rw-r--r--gnu/lib/libg++/g++-include/HypGeom.h78
-rw-r--r--gnu/lib/libg++/g++-include/Incremental.h13
-rw-r--r--gnu/lib/libg++/g++-include/Integer.h1114
-rw-r--r--gnu/lib/libg++/g++-include/LogNorm.h84
-rw-r--r--gnu/lib/libg++/g++-include/MLCG.h97
-rw-r--r--gnu/lib/libg++/g++-include/Makefile58
-rw-r--r--gnu/lib/libg++/g++-include/NegExp.h63
-rw-r--r--gnu/lib/libg++/g++-include/Normal.h74
-rw-r--r--gnu/lib/libg++/g++-include/Obstack.h226
-rw-r--r--gnu/lib/libg++/g++-include/Pix.h9
-rw-r--r--gnu/lib/libg++/g++-include/PlotFile.h154
-rw-r--r--gnu/lib/libg++/g++-include/Poisson.h60
-rw-r--r--gnu/lib/libg++/g++-include/RNG.h88
-rw-r--r--gnu/lib/libg++/g++-include/Random.h67
-rw-r--r--gnu/lib/libg++/g++-include/Rational.h270
-rw-r--r--gnu/lib/libg++/g++-include/Regex.h76
-rw-r--r--gnu/lib/libg++/g++-include/RndInt.h169
-rw-r--r--gnu/lib/libg++/g++-include/SFile.h88
-rw-r--r--gnu/lib/libg++/g++-include/SmplHist.h82
-rw-r--r--gnu/lib/libg++/g++-include/SmplStat.h73
-rw-r--r--gnu/lib/libg++/g++-include/String.h1341
-rw-r--r--gnu/lib/libg++/g++-include/Uniform.h81
-rw-r--r--gnu/lib/libg++/g++-include/Weibull.h83
-rw-r--r--gnu/lib/libg++/g++-include/abs.h1
-rw-r--r--gnu/lib/libg++/g++-include/bool.h10
-rw-r--r--gnu/lib/libg++/g++-include/builtin.h276
-rw-r--r--gnu/lib/libg++/g++-include/compare.h98
-rw-r--r--gnu/lib/libg++/g++-include/complex.h9
-rw-r--r--gnu/lib/libg++/g++-include/fcntl.h31
-rw-r--r--gnu/lib/libg++/g++-include/file.h8
-rw-r--r--gnu/lib/libg++/g++-include/filebuf.h63
-rw-r--r--gnu/lib/libg++/g++-include/generic.h63
-rw-r--r--gnu/lib/libg++/g++-include/grp.h43
-rw-r--r--gnu/lib/libg++/g++-include/istream.h259
-rw-r--r--gnu/lib/libg++/g++-include/malloc.h1
-rw-r--r--gnu/lib/libg++/g++-include/math-68881.h518
-rw-r--r--gnu/lib/libg++/g++-include/math.h223
-rw-r--r--gnu/lib/libg++/g++-include/max.h1
-rw-r--r--gnu/lib/libg++/g++-include/memory.h43
-rw-r--r--gnu/lib/libg++/g++-include/min.h1
-rw-r--r--gnu/lib/libg++/g++-include/minmax.h1
-rw-r--r--gnu/lib/libg++/g++-include/netdb.h6
-rw-r--r--gnu/lib/libg++/g++-include/new.h33
-rw-r--r--gnu/lib/libg++/g++-include/open.h39
-rw-r--r--gnu/lib/libg++/g++-include/osfcn.h4
-rw-r--r--gnu/lib/libg++/g++-include/ostream.h256
-rw-r--r--gnu/lib/libg++/g++-include/pwd.h38
-rw-r--r--gnu/lib/libg++/g++-include/regex.h280
-rw-r--r--gnu/lib/libg++/g++-include/setjmp.h31
-rw-r--r--gnu/lib/libg++/g++-include/signal.h82
-rw-r--r--gnu/lib/libg++/g++-include/std.h4
-rw-r--r--gnu/lib/libg++/g++-include/stdarg.h5
-rw-r--r--gnu/lib/libg++/g++-include/stddef.h14
-rw-r--r--gnu/lib/libg++/g++-include/stdio.h182
-rw-r--r--gnu/lib/libg++/g++-include/stdlib.h81
-rw-r--r--gnu/lib/libg++/g++-include/strclass.h8
-rw-r--r--gnu/lib/libg++/g++-include/stream.h13
-rw-r--r--gnu/lib/libg++/g++-include/streambuf.h165
-rw-r--r--gnu/lib/libg++/g++-include/string.h47
-rw-r--r--gnu/lib/libg++/g++-include/strings.h3
-rw-r--r--gnu/lib/libg++/g++-include/swap.h3
-rw-r--r--gnu/lib/libg++/g++-include/sys/signal.h39
-rw-r--r--gnu/lib/libg++/g++-include/sys/socket.h65
-rw-r--r--gnu/lib/libg++/g++-include/sys/stat.h49
-rw-r--r--gnu/lib/libg++/g++-include/sys/time.h43
-rw-r--r--gnu/lib/libg++/g++-include/sys/times.h22
-rw-r--r--gnu/lib/libg++/g++-include/sys/types.h27
-rw-r--r--gnu/lib/libg++/g++-include/sys/wait.h44
-rw-r--r--gnu/lib/libg++/g++-include/time.h110
-rw-r--r--gnu/lib/libg++/g++-include/unistd.h189
-rw-r--r--gnu/lib/libg++/libg++/SFile.cc53
-rw-r--r--gnu/lib/libg++/libg++/Sample.cc241
-rw-r--r--gnu/lib/libg++/libg++/ctype.cc4
-rw-r--r--gnu/lib/libg++/libg++/curses.cc4
-rw-r--r--gnu/lib/libg++/libg++/delete.cc38
-rw-r--r--gnu/lib/libg++/libg++/filebuf.cc192
-rw-r--r--gnu/lib/libg++/libg++/form.cc56
-rw-r--r--gnu/lib/libg++/libg++/g++.order70
-rw-r--r--gnu/lib/libg++/libg++/gnulib3.c109
-rw-r--r--gnu/lib/libg++/libg++/istream.cc507
-rw-r--r--gnu/lib/libg++/libg++/itoa.cc226
-rw-r--r--gnu/lib/libg++/libg++/malloc.c1261
-rw-r--r--gnu/lib/libg++/libg++/max.cc4
-rw-r--r--gnu/lib/libg++/libg++/min.cc4
-rw-r--r--gnu/lib/libg++/libg++/open.cc46
-rw-r--r--gnu/lib/libg++/libg++/ostream.cc224
-rw-r--r--gnu/lib/libg++/libg++/std.cc4
-rw-r--r--gnu/lib/libg++/libg++/streambuf.cc138
-rw-r--r--gnu/lib/libg++/libg++/xyzzy.cc12
100 files changed, 0 insertions, 13993 deletions
diff --git a/gnu/lib/libg++/g++-include/CursesW.h b/gnu/lib/libg++/g++-include/CursesW.h
deleted file mode 100644
index 7056db5dc56..00000000000
--- a/gnu/lib/libg++/g++-include/CursesW.h
+++ /dev/null
@@ -1,397 +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 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.
-*/
-
-#ifndef _CursesWindow_h
-#ifdef __GNUG__
-#pragma once
-#pragma interface
-#endif
-#define _CursesWindow_h
-#ifdef __GNUG__
-#pragma once
-#pragma interface
-#endif
-
-#include <curses.h>
-
-/*
- *
- * 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, 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(cbool bf);
- int clrtobot();
- int clrtoeol();
- int delch();
- int mvdelch(int y, int x);
- int deleteln();
-
-// screen control
- int scroll();
- int scrollok(cbool bf);
- int touchwin();
- int refresh();
- int leaveok(cbool bf);
- int flushok(cbool bf);
- int standout();
- int standend();
-
-// multiple window control
- int overlay(CursesWindow &win);
- int overwrite(CursesWindow &win);
-
-
-// traversal support
- CursesWindow* child();
- CursesWindow* sibling();
- CursesWindow* parent();
-};
-
-#if defined(__OPTIMIZE__) || defined(USE_LIBGXX_INLINES)
-
-
-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)
-{
- return ::waddstr(w, 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)==0) ? 0 : ::waddch(w, ch);
-}
-
-inline int CursesWindow::mvgetch(int y, int x)
-{
- return (::wmove(w, y, x)==0) ? 0 : ::wgetch(w);
-}
-
-inline int CursesWindow::mvaddstr(int y, int x, char * str)
-{
- return (::wmove(w, y, x)==0) ? 0 : ::waddstr(w, str);
-}
-
-inline int CursesWindow::mvgetstr(int y, int x, char * str)
-{
- return (::wmove(w, y, x)==0) ? 0 : ::wgetstr(w, str);
-}
-
-inline int CursesWindow::mvinch(int y, int x)
-{
- return (::wmove(w, y, x)==0) ? 0 : ::winch(w);
-}
-
-inline int CursesWindow::mvdelch(int y, int x)
-{
- return (::wmove(w, y, x)==0) ? 0 : ::wdelch(w);
-}
-
-inline int CursesWindow::mvinsch(int y, int x, char ch)
-{
- return (::wmove(w, y, x)==0) ? 0 : ::winsch(w, ch);
-}
-
-inline int CursesWindow::refresh()
-{
- return ::wrefresh(w);
-}
-
-inline int CursesWindow::clearok(cbool bf)
-{
- return ::clearok(w,bf);
-}
-
-inline int CursesWindow::leaveok(cbool bf)
-{
- return ::leaveok(w,bf);
-}
-
-inline int CursesWindow::scrollok(cbool bf)
-{
- return ::scrollok(w,bf);
-}
-
-inline int CursesWindow::flushok(cbool bf)
-{
- return ::flushok(w, bf);
-}
-
-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
-#endif
diff --git a/gnu/lib/libg++/g++-include/DiscUnif.h b/gnu/lib/libg++/g++-include/DiscUnif.h
deleted file mode 100644
index d99a7d47f97..00000000000
--- a/gnu/lib/libg++/g++-include/DiscUnif.h
+++ /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 Dirk Grunwald (grunwald@cs.uiuc.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.
-*/
-#ifndef _DiscreteUniform_h
-#ifdef __GNUG__
-#pragma once
-#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()();
-};
-
-#if defined(__OPTIMIZE__) || defined(USE_LIBGXX_INLINES)
-
-inline DiscreteUniform::DiscreteUniform(long low, long high, RNG *gen) : (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
-#endif
diff --git a/gnu/lib/libg++/g++-include/Erlang.h b/gnu/lib/libg++/g++-include/Erlang.h
deleted file mode 100644
index e770e5a5924..00000000000
--- a/gnu/lib/libg++/g++-include/Erlang.h
+++ /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 Dirk Grunwald (grunwald@cs.uiuc.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.
-*/
-#ifndef _Erlang_h
-#ifdef __GNUG__
-#pragma once
-#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()();
-
-};
-
-#if defined(__OPTIMIZE__) || defined(USE_LIBGXX_INLINES)
-
-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) : (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
-#endif
diff --git a/gnu/lib/libg++/g++-include/File.h b/gnu/lib/libg++/g++-include/File.h
deleted file mode 100644
index ce9dbef8bf0..00000000000
--- a/gnu/lib/libg++/g++-include/File.h
+++ /dev/null
@@ -1,302 +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 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.
-*/
-
-#ifndef _File_h
-#ifdef __GNUG__
-#pragma once
-#pragma interface
-#endif
-#define _File_h 1
-
-#include <builtin.h>
-#include <stdio.h>
-#include <stddef.h>
-
-#include <Fmodes.h>
-
-class Filebuf;
-
-class File
-{
- friend class Filebuf;
-protected:
- FILE* fp; // _iobuf file pointer
- char* nm; // file name (dynamically allocated)
- char rw; // 1 = read; 2 = write; 3 = readwrite
- // bit 2 (4) means read/write into string
- state_value state; // _good/_eof/_fail/_bad
- long stat; // last read/write/... return value
-
- void initialize();
- void reinitialize(const char*);
- char *readline (int chunk_number, char terminator);
-
-public:
- File();
- File(const char* filename, io_mode m, access_mode a);
- File(const char* filename, const char* m);
- File(int filedesc, io_mode m);
- File(FILE* fileptr);
- File(int sz, char* buf, io_mode m);
-
- ~File();
-
-// binding, rebinding, unbinding to physical files
-
- File& open(const char* filename, io_mode m, access_mode a);
- File& open(const char* filename, const char* m);
- File& open(int filedesc, io_mode m);
- File& open(FILE* fileptr);
-
- File& close();
- File& remove();
-
-// class variable access
-
- int filedesc();
- const char* name();
- void setname(const char* newname);
- int iocount();
-
- int rdstate();
- int eof();
- int fail();
- int bad();
- int good();
-
-// other status queries
-
- int readable();
- int writable();
- int is_open();
-
- operator void*();
-
-// error handling
-
- void error();
- void clear(state_value f = _good); // poorly named
- void set(state_value f); // set corresponding but
- void unset(state_value f); // clear corresponding bit
- File& failif(int cond);
- void check_state();
-
-// character IO
-
- File& get(char& c);
- File& put(char c);
- File& unget(char c);
- File& putback(char c); // a synonym for unget
-
-// char* IO
-
- File& put(const char* s);
- File& get (char* s, int n, char terminator = '\n');
- File& getline(char* s, int n, char terminator = '\n');
- File& gets (char **s, char terminator = '\n');
-
-// binary IO
-
- File& read(void* x, int sz, int n);
- File& write(void* x, int sz, int n);
-
-// formatted IO
-
- File& form(const char* ...);
- File& scan(const char* ...);
-
-// buffer IO
-
- File& flush();
-
-// position control
-
- File& seek(long pos, int seek_mode=0); // default seek mode=absolute
- long tell();
-
-// buffer control
-
- File& setbuf(int buffer_kind); // legal vals: _IONBF, _IOFBF, _IOLBF
- File& setbuf(int size, char* buf);
- File& raw();
-};
-
-
-// error handlers
-
-extern void verbose_File_error_handler(const char*);
-extern void quiet_File_error_handler(const char*);
-extern void fatal_File_error_handler(const char*);
-extern one_arg_error_handler_t File_error_handler;
-extern one_arg_error_handler_t set_File_error_handler(one_arg_error_handler_t);
-
-#if defined(__OPTIMIZE__) || defined(USE_LIBGXX_INLINES)
-
-
-
-inline int File::filedesc()
-{
- return fileno(fp);
-}
-
-inline const char* File::name()
-{
- return nm;
-}
-
-inline int File::iocount()
-{
- return stat;
-}
-
-inline void File::clear(state_value flag)
-{
- state = flag;
-}
-
-inline void File::set(state_value flag)
-{
- state = state_value(int(state) | int(flag));
-}
-
-inline void File::unset(state_value flag)
-{
- state = state_value(int(state) & ~int(flag));
-}
-
-inline int File::readable()
-{
- if (fp != 0) { if (feof(fp)) set(_eof); if (ferror(fp)) set(_bad);}
- return (state == _good && (rw & 01));
-}
-
-inline int File::writable()
-{
- if (fp != 0 && ferror(fp)) set(_bad);
- return ((int(state) & (int(_fail)|int(_bad))) == 0 && (rw & 02));
-}
-
-inline int File::is_open()
-{
- return (fp != 0);
-}
-
-
-inline File& File::raw()
-{
- return this->File::setbuf(_IONBF);
-}
-
-
-inline File& File::failif(int cond)
-{
- if (cond) set(_fail); return *this;
-}
-
-inline File& File::get(char& c)
-{
- if (readable())
- {
- int ch = getc(fp);
- c = ch;
- failif (ch == EOF);
- }
- return *this;
-}
-
-inline File& File::put(char c)
-{
- return failif (!writable() || putc(c, fp) == EOF);
-}
-
-inline File& File::unget(char c)
-{
- return failif(!is_open() || !(rw & 01) || ungetc(c, fp) == EOF);
-}
-
-inline File& File::putback(char c)
-{
- return failif (!is_open() || !(rw & 01) || ungetc(c, fp) == EOF);
-}
-
-inline File& File::read(void* x, int sz, int n)
-{
- return failif (!readable() || (stat = fread(x, sz, n, fp)) != n);
-}
-
-inline File& File::write(void* x, int sz, int n)
-{
- return failif (!writable() || (stat = fwrite(x, sz, n, fp)) != n);
-}
-
-inline File& File::flush()
-{
- return failif(!is_open() || fflush(fp) == EOF);
-}
-
-
-inline File& File::seek(long pos, int seek_mode)
-{
- return failif (!is_open() || fseek(fp, pos, seek_mode) < 0);
-}
-
-inline long File::tell()
-{
- failif (!is_open() || ((stat = ftell(fp)) < 0));
- return stat;
-}
-
-inline int File::rdstate()
-{
- check_state(); return state; // check_state is necessary in rare but
-} // possible circumstances
-
-inline File::operator void*()
-{
- check_state(); return (int(state) & (int(_bad)|int(_fail)))? 0 : this ;
-}
-
-inline int File::eof()
-{
- check_state(); return state & _eof;
-}
-
-inline int File::fail()
-{
- check_state(); return state & _fail;
-}
-
-inline int File::bad()
-{
- check_state(); return state & _bad;
-}
-
-inline int File::good()
-{
- check_state(); return rdstate() == _good;
-}
-
-
-#endif
-
-#endif
diff --git a/gnu/lib/libg++/g++-include/Filebuf.h b/gnu/lib/libg++/g++-include/Filebuf.h
deleted file mode 100644
index 2124e21c13d..00000000000
--- a/gnu/lib/libg++/g++-include/Filebuf.h
+++ /dev/null
@@ -1,32 +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 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.
-*/
-
-#ifndef _Filebuf_h
-#ifdef __GNUG__
-#pragma once
-#pragma interface
-#endif
-#define _Filebuf_h 1
-
-
-#endif
diff --git a/gnu/lib/libg++/g++-include/Fix.h b/gnu/lib/libg++/g++-include/Fix.h
deleted file mode 100644
index d325228ce51..00000000000
--- a/gnu/lib/libg++/g++-include/Fix.h
+++ /dev/null
@@ -1,468 +0,0 @@
-//
-// Fix.h : variable length fixed point data type
-//
-
-#ifndef _Fix_h
-#ifdef __GNUG__
-#pragma once
-#pragma interface
-#endif
-#define _Fix_h 1
-
-#include <stream.h>
-#include <std.h>
-#include <stddef.h>
-#include <Integer.h>
-
-typedef unsigned short uint16;
-typedef short int16;
-typedef unsigned long uint32;
-typedef long int32;
-
-#define _Fix_min_length 1
-#define _Fix_max_length 65535
-
-#define _Fix_min_value -1.0
-#define _Fix_max_value 1.0
-
-extern uint16 Fix_default_length;
-extern int Fix_default_print_width;
-
-struct _Frep // internal Fix representation
-{
- uint16 len; // length in bits
- uint16 siz; // allocated storage
- int16 ref; // reference count
- uint16 s[1]; // start of ushort array represention
-};
-
-typedef struct _Frep* _Fix;
-
-extern _Frep _Frep_0;
-extern _Frep _Frep_m1;
-extern _Frep _Frep_quotient_bump;
-
-class Fix
-{
- _Fix rep;
-
- Fix(_Fix);
-
- void unique();
-
-public:
- Fix();
- Fix(Fix&);
- Fix(double&);
- Fix(int);
- Fix(int, Fix&);
- Fix(int, double&);
- Fix(int, _Frep*);
-
- ~Fix();
-
- Fix operator = (Fix&);
- Fix operator = (double&);
-
- friend int operator == (Fix&, Fix& );
- friend int operator != (Fix&, Fix&);
-
- friend int operator < (Fix&, Fix&);
- friend int operator <= (Fix&, Fix&);
- friend int operator > (Fix&, Fix&);
- friend int operator >= (Fix&, Fix&);
-
- Fix& operator + ();
- Fix operator - ();
-
- friend Fix operator + (Fix&, Fix&);
- friend Fix operator - (Fix&, Fix&);
- friend Fix operator * (Fix&, Fix&);
- friend Fix operator / (Fix&, Fix&);
-
- friend Fix operator * (Fix&, int);
- friend Fix operator * (int, Fix&);
- friend Fix operator % (Fix&, int);
- friend Fix operator << (Fix&, int);
- friend Fix operator >> (Fix&, int);
-
-#ifdef __GNUG__
- friend Fix operator <? (Fix&, Fix&); // min
- friend Fix operator >? (Fix&, Fix&); // max
-#endif
-
- Fix operator += (Fix&);
- Fix operator -= (Fix&);
- Fix operator *= (Fix&);
- Fix operator /= (Fix&);
-
- Fix operator *= (int);
- Fix operator %= (int);
- Fix operator <<=(int);
- Fix operator >>=(int);
-
- friend char* Ftoa(Fix&, int width = Fix_default_print_width);
- friend Fix atoF(const char*, int len = Fix_default_length);
-
- friend istream& operator >> (istream&, Fix&);
- friend ostream& operator << (ostream&, Fix&);
-
- // built-in functions
- friend Fix abs(Fix); // absolute value
- friend int sgn(Fix&); // -1, 0, +1
- friend Integer mantissa(Fix&); // integer representation
- friend double value(Fix&); // double value
- friend int length(Fix&); // field length
- friend void show(Fix&); // show contents
-
- // error handlers
- void error(const char* msg); // error handler
- void range_error(const char* msg); // range error handler
-
- // internal class functions
- friend void mask(_Fix);
- friend int compare(_Fix, _Fix = &_Frep_0);
-
- friend _Fix new_Fix(uint16);
- friend _Fix new_Fix(uint16, _Fix);
- friend _Fix new_Fix(uint16, double);
-
- friend _Fix copy(_Fix, _Fix);
- friend _Fix negate(_Fix, _Fix = NULL);
- friend _Fix add(_Fix, _Fix, _Fix = NULL);
- friend _Fix subtract(_Fix, _Fix, _Fix = NULL);
- friend _Fix multiply(_Fix, _Fix, _Fix = NULL);
- friend _Fix multiply(_Fix, int, _Fix = NULL);
- friend _Fix divide(_Fix, _Fix, _Fix = NULL, _Fix = NULL);
- friend _Fix shift(_Fix, int, _Fix = NULL);
-
- // non-operator versions for user
- friend void negate(Fix& x, Fix& r);
- friend void add(Fix& x, Fix& y, Fix& r);
- friend void subtract(Fix& x, Fix& y, Fix& r);
- friend void multiply(Fix& x, Fix& y, Fix& r);
- friend void divide(Fix& x, Fix& y, Fix& q, Fix& r);
- friend void shift(Fix& x, int y, Fix& r);
-};
-
-// error handlers
-
-extern void
- default_Fix_error_handler(const char*),
- default_Fix_range_error_handler(const char*);
-
-extern one_arg_error_handler_t
- Fix_error_handler,
- Fix_range_error_handler;
-
-extern one_arg_error_handler_t
- set_Fix_error_handler(one_arg_error_handler_t f),
- set_Fix_range_error_handler(one_arg_error_handler_t f);
-
-typedef void (*Fix_peh)(_Fix&);
-extern Fix_peh Fix_overflow_handler;
-
-extern void
- Fix_overflow_saturate(_Fix&),
- Fix_overflow_wrap(_Fix&),
- Fix_overflow_warning_saturate(_Fix&),
- Fix_overflow_warning(_Fix&),
- Fix_overflow_error(_Fix&);
-
-extern Fix_peh set_overflow_handler(Fix_peh);
-
-extern int Fix_set_default_length(int);
-
-// function definitions
-
-#if defined(__OPTIMIZE__) || defined(USE_LIBGXX_INLINES)
-
-inline void Fix::unique()
-{
- if ( rep->ref > 1 )
- {
- rep->ref--;
- rep = new_Fix(rep->len,rep);
- }
-}
-
-inline void mask (_Fix x)
-{
- int n = x->len & 0x0f;
- if ( n )
- x->s[x->siz - 1] &= 0xffff0000 >> n;
-}
-
-inline _Fix copy(_Fix from, _Fix to)
-{
- uint16 *ts = to->s, *fs = from->s;
- int ilim = to->siz < from->siz ? to->siz : from->siz;
- for ( int i=0; i < ilim; i++ )
- *ts++ = *fs++;
- for ( ; i < to->siz; i++ )
- *ts++ = 0;
- mask(to);
- return to;
-}
-
-inline Fix::Fix(_Fix f)
-{
- rep = f;
-}
-
-inline Fix::Fix()
-{
- rep = new_Fix(Fix_default_length);
-}
-
-inline Fix::Fix(int len)
-{
- if ( len < _Fix_min_length || len > _Fix_max_length )
- error("illegal length in declaration");
- rep = new_Fix((uint16 )len);
-}
-
-inline Fix::Fix(double& d)
-{
- rep = new_Fix(Fix_default_length,d);
-}
-
-inline Fix::Fix(Fix& y)
-{
- rep = y.rep; rep->ref++;
-}
-
-inline Fix::Fix(int len, Fix& y)
-{
- if ( len < _Fix_min_length || len > _Fix_max_length )
- error("illegal length in declaration");
- rep = new_Fix((uint16 )len,y.rep);
-}
-
-inline Fix::Fix(int len, _Frep* fr)
-{
- if ( len < 1 || len > 65535 )
- error("illegal length in declaration");
- rep = new_Fix((uint16 )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((uint16 )len,d);
-}
-
-inline Fix::~Fix()
-{
- if ( --rep->ref <= 0 ) delete rep;
-}
-
-inline Fix Fix::operator = (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 == (Fix& x, Fix& y)
-{
- return compare(x.rep, y.rep) == 0;
-}
-
-inline int operator != (Fix& x, Fix& y)
-{
- return compare(x.rep, y.rep) != 0;
-}
-
-inline int operator < (Fix& x, Fix& y)
-{
- return compare(x.rep, y.rep) < 0;
-}
-
-inline int operator <= (Fix& x, Fix& y)
-{
- return compare(x.rep, y.rep) <= 0;
-}
-
-inline int operator > (Fix& x, Fix& y)
-{
- return compare(x.rep, y.rep) > 0;
-}
-
-inline int operator >= (Fix& x, Fix& y)
-{
- return compare(x.rep, y.rep) >= 0;
-}
-
-inline Fix& Fix::operator + ()
-{
- return *this;
-}
-
-inline Fix Fix::operator - ()
-{
- _Fix r = negate(rep); return r;
-}
-
-inline Fix operator + (Fix& x, Fix& y)
-{
- _Fix r = add(x.rep, y.rep); return r;
-}
-
-inline Fix operator - (Fix& x, Fix& y)
-{
- _Fix r = subtract(x.rep, y.rep); return r;
-}
-
-inline Fix operator * (Fix& x, Fix& y)
-{
- _Fix r = multiply(x.rep, y.rep); return r;
-}
-
-inline Fix operator * (Fix& x, int y)
-{
- _Fix r = multiply(x.rep, y); return r;
-}
-
-inline Fix operator * (int y, Fix& x)
-{
- _Fix r = multiply(x.rep, y); return r;
-}
-
-inline Fix operator / (Fix& x, Fix& y)
-{
- _Fix r = divide(x.rep, y.rep); return r;
-}
-
-inline Fix Fix::operator += (Fix& y)
-{
- unique(); add(rep, y.rep, rep); return *this;
-}
-
-inline Fix Fix::operator -= (Fix& y)
-{
- unique(); subtract(rep, y.rep, rep); return *this;
-}
-
-inline Fix Fix::operator *= (Fix& y)
-{
- unique(); multiply(rep, y.rep, rep); return *this;
-}
-
-inline Fix Fix::operator *= (int y)
-{
- unique(); multiply(rep, y, rep); return *this;
-}
-
-inline Fix Fix::operator /= (Fix& y)
-{
- unique(); divide(rep, y.rep, rep); return *this;
-}
-
-inline Fix operator % (Fix& x, int y)
-{
- Fix r((int )x.rep->len + y, x); return r;
-}
-
-inline Fix operator << (Fix& x, int y)
-{
- _Fix rep = shift(x.rep, y); return rep;
-}
-
-inline Fix operator >> (Fix& x, int y)
-{
- _Fix rep = shift(x.rep, -y); return rep;
-}
-
-inline Fix Fix::operator <<= (int y)
-{
- unique(); shift(rep, y, rep); return *this;
-}
-
-inline Fix Fix::operator >>= (int y)
-{
- unique(); shift(rep, -y, rep); return *this;
-}
-
-#ifdef __GNUG__
-inline Fix operator <? (Fix& x, Fix& y)
-{
- if ( compare(x.rep, y.rep) <= 0 ) return x; else return y;
-}
-
-inline Fix operator >? (Fix& x, Fix& y)
-{
- if ( compare(x.rep, y.rep) >= 0 ) return x; else return y;
-}
-#endif
-
-inline Fix abs(Fix x)
-{
- _Fix r = (compare(x.rep) >= 0 ? new_Fix(x.rep->len,x.rep) : negate(x.rep));
- return r;
-}
-
-inline int sgn(Fix& x)
-{
- int a = compare(x.rep);
- return a == 0 ? 0 : (a > 0 ? 1 : -1);
-}
-
-inline int length(Fix& x)
-{
- return x.rep->len;
-}
-
-inline ostream& operator << (ostream& s, Fix& y)
-{
- return s << Ftoa(y);
-}
-
-inline void negate (Fix& x, Fix& r)
-{
- negate(x.rep, r.rep);
-}
-
-inline void add (Fix& x, Fix& y, Fix& r)
-{
- add(x.rep, y.rep, r.rep);
-}
-
-inline void subtract (Fix& x, Fix& y, Fix& r)
-{
- subtract(x.rep, y.rep, r.rep);
-}
-
-inline void multiply (Fix& x, Fix& y, Fix& r)
-{
- multiply(x.rep, y.rep, r.rep);
-}
-
-inline void divide (Fix& x, Fix& y, Fix& q, Fix& r)
-{
- divide(x.rep, y.rep, q.rep, r.rep);
-}
-
-inline void shift (Fix& x, int y, Fix& r)
-{
- shift(x.rep, y, r.rep);
-}
-
-#endif
-#endif
diff --git a/gnu/lib/libg++/g++-include/Fix16.h b/gnu/lib/libg++/g++-include/Fix16.h
deleted file mode 100644
index 0024c9da110..00000000000
--- a/gnu/lib/libg++/g++-include/Fix16.h
+++ /dev/null
@@ -1,647 +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 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.
-*/
-
-#ifndef _Fix16_h
-#ifdef __GNUG__
-#pragma once
-#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)((unsigned long)(1 << 31)))
-
-#define Fix32_msb ((unsigned long)(1 << 31))
-#define Fix32_m_max ((1 << 31) - 1)
-#define Fix32_m_min ((long)(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();
-
-
-public:
- Fix16();
- Fix16(Fix16& f);
- Fix16(double d);
- Fix16(Fix32& f);
-
- ~Fix16();
-
- Fix16& operator=(Fix16& f);
- Fix16& operator=(double d);
- Fix16& operator=(Fix32& f);
-
- friend short& mantissa(Fix16& f);
- friend double value(Fix16& f);
-
- Fix16 operator + ();
- Fix16 operator - ();
-
- friend Fix16 operator + (Fix16& f, Fix16& g);
- friend Fix16 operator - (Fix16& f, Fix16& g);
- friend Fix32 operator * (Fix16& f, Fix16& g);
- friend Fix16 operator / (Fix16& f, Fix16& g);
- friend Fix16 operator << (Fix16& f, int b);
- friend Fix16 operator >> (Fix16& f, int b);
-
- Fix16& operator += (Fix16& f);
- Fix16& operator -= (Fix16& f);
- Fix16& operator *= (Fix16& );
- Fix16& operator /= (Fix16& f);
-
- Fix16& operator <<=(int b);
- Fix16& operator >>=(int b);
-
- friend int operator == (Fix16& f, Fix16& g);
- friend int operator != (Fix16& f, Fix16& g);
- friend int operator >= (Fix16& f, Fix16& g);
- friend int operator <= (Fix16& f, Fix16& g);
- friend int operator > (Fix16& f, Fix16& g);
- friend int operator < (Fix16& f, Fix16& g);
-
- friend istream& operator >> (istream& s, Fix16& f);
- friend ostream& operator << (ostream& s, Fix16& f);
-
- void overflow(short&);
- void range_error(short&);
-
- friend Fix16 operator * (Fix16& f, int g);
- friend Fix16 operator * (int g, 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;
-
- long m;
-
- long round(double d);
- long assign(double d);
-
- Fix32(long i);
- operator double();
-
-
-public:
- Fix32();
- Fix32(Fix32& f);
- Fix32(Fix16& f);
- Fix32(double d);
- ~Fix32();
-
- Fix32& operator = (Fix32& f);
- Fix32& operator = (Fix16& f);
- Fix32& operator = (double d);
-
- friend long& mantissa(Fix32& f);
- friend double value(Fix32& f);
-
- Fix32 operator + ();
- Fix32 operator - ();
-
- friend Fix32 operator + (Fix32& f, Fix32& g);
- friend Fix32 operator - (Fix32& f, Fix32& g);
- friend Fix32 operator * (Fix32& f, Fix32& g);
- friend Fix32 operator / (Fix32& f, Fix32& g);
- friend Fix32 operator << (Fix32& f, int b);
- friend Fix32 operator >> (Fix32& f, int b);
-
- friend Fix32 operator * (Fix16& f, Fix16& g);
-
- Fix32& operator += (Fix32& f);
- Fix32& operator -= (Fix32& f);
- Fix32& operator *= (Fix32& f);
- Fix32& operator /= (Fix32& f);
- Fix32& operator <<=(int b);
- Fix32& operator >>=(int b);
-
- friend int operator == (Fix32& f, Fix32& g);
- friend int operator != (Fix32& f, Fix32& g);
- friend int operator >= (Fix32& f, Fix32& g);
- friend int operator <= (Fix32& f, Fix32& g);
- friend int operator > (Fix32& f, Fix32& g);
- friend int operator < (Fix32& f, Fix32& g);
-
- friend istream& operator >> (istream& s, Fix32& f);
- friend ostream& operator << (ostream& s, Fix32& f);
-
- void overflow(long& i);
- void range_error(long& i);
-
- friend Fix32 operator * (Fix32& f, int g);
- friend Fix32 operator * (int g, Fix32& f);
- Fix32& operator *= (int g);
-};
-
-// active error handler declarations
-
-typedef void (*Fix16_peh)(short&);
-typedef void (*Fix32_peh)(long&);
-
-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(long&),
- Fix32_overflow_saturate(long&),
- Fix32_overflow_warning_saturate(long&),
- Fix32_warning(long&),
- Fix32_abort(long&);
-
-#if defined(__OPTIMIZE__) || defined(USE_LIBGXX_INLINES)
-
-inline Fix16::~Fix16() {}
-
-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()
-{
- return Fix16_div * m;
-}
-
-inline Fix16::Fix16()
-{
- m = 0;
-}
-
-inline Fix16::Fix16(Fix16& f)
-{
- m = f.m;
-}
-
-inline Fix16::Fix16(double d)
-{
- m = assign(d);
-}
-
-
-inline Fix16& Fix16::operator=(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(long i)
-{
- m = i;
-}
-
-inline Fix32:: operator double()
-{
- return Fix32_div * m;
-}
-
-
-inline Fix32::Fix32(Fix32& f)
-{
- m = f.m;
-}
-
-inline Fix32::Fix32(Fix16& f)
-{
- m = long(f.m) << 16;
-}
-
-inline Fix32::Fix32(double d)
-{
- m = assign(d);
-}
-
-inline Fix16::Fix16(Fix32& f)
-{
- m = f.m >> 16;
-}
-
-
-inline Fix16& Fix16::operator=(Fix32& f)
-{
- m = f.m >> 16;
- return *this;
-}
-
-inline Fix32& Fix32::operator=(Fix32& f)
-{
- m = f.m;
- return *this;
-}
-
-inline Fix32& Fix32::operator=(Fix16& f)
-{
- m = long(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 double value(Fix16& f)
-{
- return double(f);
-}
-
-inline Fix16 Fix16::operator+()
-{
- return m;
-}
-
-inline Fix16 Fix16::operator-()
-{
- return -m;
-}
-
-inline Fix16 operator+(Fix16& f, 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-(Fix16& f, 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*(Fix16& f, Fix16& g)
-{
- return Fix32( long( long(f.m) * long(g.m) << 1));
-}
-
-inline Fix16 operator<<(Fix16& a, int b)
-{
- return a.m << b;
-}
-
-inline Fix16 operator>>(Fix16& a, int b)
-{
- return a.m >> b;
-}
-
-inline Fix16& Fix16:: operator+=(Fix16& f)
-{
- return *this = *this + f;
-}
-
-inline Fix16& Fix16:: operator-=(Fix16& f)
-{
- return *this = *this - f;
-}
-
-inline Fix16& Fix16::operator*=(Fix16& f)
-{
- return *this = *this * f;
-}
-
-inline Fix16& Fix16:: operator/=(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==(Fix16& f, Fix16& g)
-{
- return f.m == g.m;
-}
-
-inline int operator!=(Fix16& f, Fix16& g)
-{
- return f.m != g.m;
-}
-
-inline int operator>=(Fix16& f, Fix16& g)
-{
- return f.m >= g.m;
-}
-
-inline int operator<=(Fix16& f, Fix16& g)
-{
- return f.m <= g.m;
-}
-
-inline int operator>(Fix16& f, Fix16& g)
-{
- return f.m > g.m;
-}
-
-inline int operator<(Fix16& f, 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, Fix16& f)
-{
- return s << double(f);
-}
-
-
-inline Fix16 operator*(Fix16& f, int g)
-{
- return Fix16(short(f.m * g));
-}
-
-inline Fix16 operator*(int g, Fix16& f)
-{
- return f * g;
-}
-
-
-inline Fix16& Fix16::operator*=(int g)
-{
- return *this = *this * g;
-}
-
-inline Fix32::~Fix32() {}
-
-inline long Fix32::round(double d)
-{
- return long( (d >= 0)? d + 0.5 : d - 0.5);
-}
-
-
-inline long& mantissa(Fix32& f)
-{
- return f.m;
-}
-
-inline double value(Fix32& f)
-{
- return double(f);
-}
-
-inline Fix32 Fix32::operator+()
-{
- return m;
-}
-
-inline Fix32 Fix32::operator-()
-{
- return -m;
-}
-
-inline Fix32 operator+(Fix32& f, Fix32& g)
-{
- long sum = f.m + g.m;
- if ( (f.m ^ sum) & (g.m ^ sum) & Fix32_msb )
- f.overflow(sum);
- return sum;
-}
-
-inline Fix32 operator-(Fix32& f, Fix32& g)
-{
- long sum = f.m - g.m;
- if ( (f.m ^ sum) & (-g.m ^ sum) & Fix32_msb )
- f.overflow(sum);
- return sum;
-}
-
-inline Fix32 operator<<(Fix32& a, int b)
-{
- return a.m << b;
-}
-
-inline Fix32 operator>>(Fix32& a, int b)
-{
- return a.m >> b;
-}
-
-inline Fix32& Fix32::operator+=(Fix32& f)
-{
- return *this = *this + f;
-}
-
-inline Fix32& Fix32::operator-=(Fix32& f)
-{
- return *this = *this - f;
-}
-
-inline Fix32& Fix32::operator*=(Fix32& f)
-{
- return *this = *this * f;
-}
-
-inline Fix32& Fix32::operator/=(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==(Fix32& f, Fix32& g)
-{
- return f.m == g.m;
-}
-
-inline int operator!=(Fix32& f, Fix32& g)
-{
- return f.m != g.m;
-}
-
-inline int operator>=(Fix32& f, Fix32& g)
-{
- return f.m >= g.m;
-}
-
-inline int operator<=(Fix32& f, Fix32& g)
-{
- return f.m <= g.m;
-}
-
-inline int operator>(Fix32& f, Fix32& g)
-{
- return f.m > g.m;
-}
-
-inline int operator<(Fix32& f, 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, Fix32& f)
-{
- return s << double(f);
-}
-
-inline Fix32 operator*(Fix32& f, int g)
-{
- return Fix32(long(f.m * g));
-}
-
-inline Fix32 operator*(int g, Fix32& f)
-{
- return f * g;
-}
-
-
-
-inline Fix32& Fix32::operator*=(int g)
-{
- return *this = *this * g;
-}
-
-
-#endif
-#endif
-
diff --git a/gnu/lib/libg++/g++-include/Fix24.h b/gnu/lib/libg++/g++-include/Fix24.h
deleted file mode 100644
index ec48afcae6e..00000000000
--- a/gnu/lib/libg++/g++-include/Fix24.h
+++ /dev/null
@@ -1,595 +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 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.
-*/
-
-#ifndef _Fix24_h
-#ifdef __GNUG__
-#pragma once
-#pragma interface
-#endif
-#define _Fix24_h 1
-
-#include <stream.h>
-#include <std.h>
-
-// extra type definitions
-
-typedef struct {
- long u;
- unsigned long 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 unsigned long
- 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;
-
- long m;
-
- long assign(double d);
- operator double();
- Fix24(long i);
- Fix24(int i);
-
-
-public:
- Fix24();
- Fix24(Fix24& f);
- Fix24(double d);
- Fix24(Fix48& f);
-
- ~Fix24();
-
- Fix24& operator=(Fix24& f);
- Fix24& operator=(double d);
- Fix24& operator=(Fix48& f);
-
- friend long& mantissa(Fix24& f);
- friend double value(Fix24& f);
-
- Fix24 operator + ();
- Fix24 operator - ();
-
- friend Fix24 operator + (Fix24& f, Fix24& g);
- friend Fix24 operator - (Fix24& f, Fix24& g);
- friend Fix48 operator * (Fix24& f, Fix24& g);
- friend Fix24 operator * (Fix24& f, int g);
- friend Fix24 operator * (int g, Fix24& f);
- friend Fix24 operator / (Fix24& f, Fix24& g);
- friend Fix24 operator << (Fix24& f, int b);
- friend Fix24 operator >> (Fix24& f, int b);
-
- Fix24& operator += (Fix24& f);
- Fix24& operator -= (Fix24& f);
- Fix24& operator *= (Fix24& f);
- Fix24& operator *= (int b);
- Fix24& operator /= (Fix24& f);
-
- Fix24& operator <<=(int b);
- Fix24& operator >>=(int b);
-
- friend int operator == (Fix24& f, Fix24& g);
- friend int operator != (Fix24& f, Fix24& g);
- friend int operator >= (Fix24& f, Fix24& g);
- friend int operator <= (Fix24& f, Fix24& g);
- friend int operator > (Fix24& f, Fix24& g);
- friend int operator < (Fix24& f, Fix24& g);
-
- friend istream& operator >> (istream& s, Fix24& f);
- friend ostream& operator << (ostream& s, Fix24& f);
-
- void overflow(long&);
- void range_error(long&);
-};
-
-
-//
-// 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();
- Fix48(twolongs i);
-
-public:
- Fix48();
- Fix48(Fix48& f);
- Fix48(Fix24& f);
- Fix48(double d);
- ~Fix48();
-
- Fix48& operator = (Fix48& f);
- Fix48& operator = (Fix24& f);
- Fix48& operator = (double d);
-
- friend twolongs& mantissa(Fix48& f);
- friend double value(Fix48& f);
-
- Fix48 operator + ();
- Fix48 operator - ();
-
- friend Fix48 operator + (Fix48& f, Fix48& g);
- friend Fix48 operator - (Fix48& f, Fix48& g);
- friend Fix48 operator * (Fix48& f, int g);
- friend Fix48 operator * (int g, Fix48& f);
- friend Fix48 operator << (Fix48& f, int b);
- friend Fix48 operator >> (Fix48& f, int b);
-
- friend Fix48 operator * (Fix24& f, Fix24& g);
-
- Fix48& operator += (Fix48& f);
- Fix48& operator -= (Fix48& f);
- Fix48& operator *= (int b);
- Fix48& operator <<=(int b);
- Fix48& operator >>=(int b);
-
- friend int operator == (Fix48& f, Fix48& g);
- friend int operator != (Fix48& f, Fix48& g);
- friend int operator >= (Fix48& f, Fix48& g);
- friend int operator <= (Fix48& f, Fix48& g);
- friend int operator > (Fix48& f, Fix48& g);
- friend int operator < (Fix48& f, Fix48& g);
-
- friend istream& operator >> (istream& s, Fix48& f);
- friend ostream& operator << (ostream& s, Fix48& f);
-
- void overflow(twolongs& i);
- void range_error(twolongs& i);
-};
-
-
-// active error handler declarations
-
-typedef void (*Fix24_peh)(long&);
-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(long&),
- Fix24_overflow_saturate(long&),
- Fix24_overflow_warning_saturate(long&),
- Fix24_warning(long&),
- Fix24_abort(long&);
-
-extern void
- Fix48_ignore(twolongs&),
- Fix48_overflow_saturate(twolongs&),
- Fix48_overflow_warning_saturate(twolongs&),
- Fix48_warning(twolongs&),
- Fix48_abort(twolongs&);
-
-#if defined(__OPTIMIZE__) || defined(USE_LIBGXX_INLINES)
-
-inline Fix24::~Fix24() {}
-
-inline Fix24::Fix24(long i)
-{
- m = i;
-}
-
-inline Fix24::Fix24(int i)
-{
- m = i;
-}
-
-inline Fix24::operator double()
-{
- return Fix24_div * m;
-}
-
-inline Fix24::Fix24()
-{
- m = 0;
-}
-
-inline Fix24::Fix24(Fix24& f)
-{
- m = f.m;
-}
-
-inline Fix24::Fix24(double d)
-{
- m = assign(d);
-}
-
-inline Fix24::Fix24(Fix48& f)
-{
- m = f.m.u;
-}
-
-inline Fix24& Fix24::operator=(Fix24& f)
-{
- m = f.m;
- return *this;
-}
-
-inline Fix24& Fix24::operator=(double d)
-{
- m = assign(d);
- return *this;
-}
-
-inline Fix24& Fix24::operator=(Fix48& f)
-{
- m = f.m.u;
- return *this;
-}
-
-inline long& mantissa(Fix24& f)
-{
- return f.m;
-}
-
-inline double value(Fix24& f)
-{
- return double(f);
-}
-
-inline Fix24 Fix24::operator+()
-{
- return m;
-}
-
-inline Fix24 Fix24::operator-()
-{
- return -m;
-}
-
-inline Fix24 operator+(Fix24& f, Fix24& g)
-{
- long sum = f.m + g.m;
- if ( (f.m ^ sum) & (g.m ^ sum) & Fix24_msb )
- f.overflow(sum);
- return sum;
-}
-
-inline Fix24 operator-(Fix24& f, Fix24& g)
-{
- long sum = f.m - g.m;
- if ( (f.m ^ sum) & (-g.m ^ sum) & Fix24_msb )
- f.overflow(sum);
- return sum;
-}
-
-inline Fix24 operator*(Fix24& a, int b)
-{
- return a.m * b;
-}
-
-inline Fix24 operator*(int b, Fix24& a)
-{
- return a * b;
-}
-
-inline Fix24 operator<<(Fix24& a, int b)
-{
- return a.m << b;
-}
-
-inline Fix24 operator>>(Fix24& a, int b)
-{
- return (a.m >> b) & 0xffffff00L;
-}
-
-inline Fix24& Fix24:: operator+=(Fix24& f)
-{
- return *this = *this + f;
-}
-
-inline Fix24& Fix24:: operator-=(Fix24& f)
-{
- return *this = *this - f;
-}
-
-inline Fix24& Fix24::operator*=(Fix24& f)
-{
- return *this = *this * f;
-}
-
-inline Fix24& Fix24:: operator/=(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==(Fix24& f, Fix24& g)
-{
- return f.m == g.m;
-}
-
-inline int operator!=(Fix24& f, Fix24& g)
-{
- return f.m != g.m;
-}
-
-inline int operator>=(Fix24& f, Fix24& g)
-{
- return f.m >= g.m;
-}
-
-inline int operator<=(Fix24& f, Fix24& g)
-{
- return f.m <= g.m;
-}
-
-inline int operator>(Fix24& f, Fix24& g)
-{
- return f.m > g.m;
-}
-
-inline int operator<(Fix24& f, 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, Fix24& f)
-{
- return s << double(f);
-}
-
-inline Fix48::~Fix48() {}
-
-inline Fix48::Fix48(twolongs i)
-{
- m = i;
-}
-
-inline Fix48:: operator double()
-{
-/*
- * 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 * ((unsigned long)(m.u & 0xffffff00))
- + Fix48_div_l * m.l) - 2;
-}
-
-inline Fix48::Fix48()
-{
- m.u = 0;
- m.l = 0;
-}
-
-inline Fix48::Fix48(Fix48& f)
-{
- m = f.m;
-}
-
-inline Fix48::Fix48(Fix24& f)
-{
- m.u = f.m;
- m.l = 0;
-}
-
-inline Fix48::Fix48(double d)
-{
- m = assign(d);
-}
-
-inline Fix48& Fix48::operator=(Fix48& f)
-{
- m = f.m;
- return *this;
-}
-
-inline Fix48& Fix48::operator=(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 double value(Fix48& f)
-{
- return double(f);
-}
-
-inline Fix48 Fix48::operator+()
-{
- return m;
-}
-
-inline Fix48 Fix48::operator-()
-{
- 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, Fix48& a)
-{
- return a * b;
-}
-
-inline Fix48& Fix48::operator+=(Fix48& f)
-{
- return *this = *this + f;
-}
-
-inline Fix48& Fix48::operator-=(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==(Fix48& f, Fix48& g)
-{
- return f.m.u == g.m.u && f.m.l == g.m.l;
-}
-
-inline int operator!=(Fix48& f, Fix48& g)
-{
- return f.m.u != g.m.u || f.m.l != g.m.l;
-}
-
-inline int operator>=(Fix48& f, Fix48& g)
-{
- return f.m.u >= g.m.u || (f.m.u == g.m.u && f.m.l >= g.m.l);
-}
-
-inline int operator<=(Fix48& f, Fix48& g)
-{
- return f.m.u <= g.m.u || (f.m.u == g.m.u && f.m.l <= g.m.l);
-}
-
-inline int operator>(Fix48& f, Fix48& g)
-{
- return f.m.u > g.m.u || (f.m.u == g.m.u && f.m.l > g.m.l);
-}
-
-inline int operator<(Fix48& f, 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, Fix48& f)
-{
- return s << double(f);
-}
-
-
-#endif
-#endif
-
diff --git a/gnu/lib/libg++/g++-include/Fmodes.h b/gnu/lib/libg++/g++-include/Fmodes.h
deleted file mode 100644
index 524c2bdc4b5..00000000000
--- a/gnu/lib/libg++/g++-include/Fmodes.h
+++ /dev/null
@@ -1,34 +0,0 @@
-
-#ifndef _Fmodes_h
-#ifdef __GNUG__
-#pragma once
-#pragma interface
-#endif
-#define _Fmodes_h 1
-
-enum io_mode // known unix file IO modes
-{
- io_readonly = 0,
- io_writeonly = 1,
- io_readwrite = 2,
- io_appendonly = 3,
- io_append = 4, // append, plus allow reads
-};
-
-enum access_mode // ways to open a file
-{
- a_createonly = 0, // create, fail if file exists
- a_create = 1, // create if doesn't exist, else truncate
- a_useonly = 2, // use (no truncate) fail if doesn't exist
- a_use = 3, // use (no truncate), create if doesn't exist
-};
-
-enum state_value // File states
-{
- _good = 0, // all is well
- _eof = 1, // at eof
- _fail = 2, // logical or physical IO error
- _bad = 4 // unopened/corrupted
-};
-
-#endif
diff --git a/gnu/lib/libg++/g++-include/Geom.h b/gnu/lib/libg++/g++-include/Geom.h
deleted file mode 100644
index d70b96a668f..00000000000
--- a/gnu/lib/libg++/g++-include/Geom.h
+++ /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 Dirk Grunwald (grunwald@cs.uiuc.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.
-*/
-#ifndef _Geometric_h
-#ifdef __GNUG__
-#pragma once
-#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()();
-
-};
-
-#if defined(__OPTIMIZE__) || defined(USE_LIBGXX_INLINES)
-
-inline Geometric::Geometric(double mean, RNG *gen) : (gen)
-{
- pMean = mean;
-}
-
-
-inline double Geometric::mean() { return pMean; }
-inline double Geometric::mean(double x) {
- double tmp = pMean; pMean = x; return tmp;
-}
-
-#endif
-#endif
diff --git a/gnu/lib/libg++/g++-include/GetOpt.h b/gnu/lib/libg++/g++-include/GetOpt.h
deleted file mode 100644
index 413c52d64c1..00000000000
--- a/gnu/lib/libg++/g++-include/GetOpt.h
+++ /dev/null
@@ -1,131 +0,0 @@
-/* Getopt for GNU.
- Copyright (C) 1987, 1989 Free Software Foundation, Inc.
- (Modified by Douglas C. Schmidt for use with GNU G++.)
-
- 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 1, 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. */
-
-
-
-/* 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 once
-#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. */
-
- static enum { REQUIRE_ORDER, PERMUTE, RETURN_IN_ORDER } 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;
- char *noptstring;
-
- GetOpt (int argc, char **argv, char *optstring);
- int operator () (void);
-};
-
-#endif
diff --git a/gnu/lib/libg++/g++-include/HypGeom.h b/gnu/lib/libg++/g++-include/HypGeom.h
deleted file mode 100644
index b120f104e9f..00000000000
--- a/gnu/lib/libg++/g++-include/HypGeom.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 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.
-*/
-#ifndef _HyperGeometric_h
-#ifdef __GNUG__
-#pragma once
-#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()();
-};
-
-#if defined(__OPTIMIZE__) || defined(USE_LIBGXX_INLINES)
-
-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)
-: (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
-#endif
diff --git a/gnu/lib/libg++/g++-include/Incremental.h b/gnu/lib/libg++/g++-include/Incremental.h
deleted file mode 100644
index 9b6bb3f8947..00000000000
--- a/gnu/lib/libg++/g++-include/Incremental.h
+++ /dev/null
@@ -1,13 +0,0 @@
-#ifndef Incremental_h
-#ifdef __GNUG__
-#pragma once
-#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/gnu/lib/libg++/g++-include/Integer.h b/gnu/lib/libg++/g++-include/Integer.h
deleted file mode 100644
index a241e65a29e..00000000000
--- a/gnu/lib/libg++/g++-include/Integer.h
+++ /dev/null
@@ -1,1114 +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 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.
-*/
-
-#ifndef _Integer_h
-#ifdef __GNUG__
-#pragma once
-#pragma interface
-#endif
-#define _Integer_h 1
-
-#include <stream.h>
-
-struct IntRep // internal Integer representations
-{
- unsigned short len; // current length
- unsigned short sz; // allocated space
- short sgn; // 1 means >= 0; 0 means < 0
- unsigned short s[1]; // represented as ushort array starting here
-};
-
-extern IntRep* Ialloc(IntRep*, const unsigned short *, int, int, int);
-extern IntRep* Icalloc(IntRep*, int);
-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 IntRep* atoIntRep(const char* s, int base = 10);
-extern long Itolong(const IntRep*);
-extern double Itodouble(const IntRep*);
-extern int Iislong(const IntRep*);
-extern int Iisdouble(const IntRep*);
-extern long lg(const IntRep*);
-
-
-class Integer
-{
-protected:
- IntRep* rep;
-public:
- Integer();
- Integer(long);
- Integer(const Integer&);
-
- ~Integer();
-
- void operator = (const Integer&);
- void operator = (long);
-
-// unary operations to self
-
- void operator ++ ();
- void operator -- ();
- void negate(); // negate in-place
- void abs(); // absolute-value in-place
- void complement(); // bitwise complement in-place
-
-// assignment-based operations
-
- void operator += (const Integer&);
- void operator -= (const Integer&);
- void operator *= (const Integer&);
- void operator /= (const Integer&);
- void operator %= (const Integer&);
- void operator <<=(const Integer&);
- void operator >>=(const Integer&);
- void operator &= (const Integer&);
- void operator |= (const Integer&);
- void operator ^= (const Integer&);
-
- void operator += (long);
- void operator -= (long);
- void operator *= (long);
- void operator /= (long);
- void operator %= (long);
- void operator <<=(long);
- void operator >>=(long);
- void operator &= (long);
- void operator |= (long);
- void operator ^= (long);
-
-// (constructive binary operations are inlined below)
-
-#ifdef __GNUG__
- 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);
- 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);
- 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);
- 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);
- 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);
- 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);
-
-// coercion & conversion
-
- int fits_in_long() const;
- int fits_in_double() const;
-
- operator long() const;
- operator double() const;
-
- friend char* Itoa(const Integer& x, int base = 10, int width = 0);
- friend Integer atoI(const char* s, int base = 10);
-
- friend istream& operator >> (istream& s, Integer& y);
- friend ostream& operator << (ostream& s, const Integer& y);
-
-// error detection
-
- int initialized() const;
- volatile 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 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 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
-
-#if defined(__OPTIMIZE__) || defined(USE_LIBGXX_INLINES)
-
-
-inline Integer::Integer() :rep(0) {}
-
-inline Integer::Integer(long y) :rep(Icopy_long(0, y)) {}
-
-inline Integer::Integer(const Integer& y) :rep(Icopy(0, y.rep)) {}
-
-inline Integer::~Integer() { delete rep; }
-
-inline void Integer::operator = (const Integer& y)
-{
- rep = Icopy(rep, y.rep);
-}
-
-inline void Integer::operator = (long y)
-{
- rep = Icopy_long(rep, y);
-}
-
-inline Integer::operator long() const
-{
- return Itolong(rep);
-}
-
-inline int Integer::initialized() const
-{
- return rep != 0;
-}
-
-inline int Integer::fits_in_long() const
-{
- return Iislong(rep);
-}
-
-inline Integer::operator double() const
-{
- return Itodouble(rep);
-}
-
-inline int Integer::fits_in_double() const
-{
- return Iisdouble(rep);
-}
-
-// 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);
-}
-
-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, '^');
-}
-
-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, long(y), 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);
-}
-
-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, '^');
-}
-
-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);
-}
-
-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, '^');
-}
-
-
-// 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 void Integer::operator += (const Integer& y)
-{
- add(*this, y, *this);
-}
-
-inline void Integer::operator += (long y)
-{
- add(*this, y, *this);
-}
-
-inline void Integer::operator ++ ()
-{
- add(*this, 1, *this);
-}
-
-
-inline void Integer::operator -= (const Integer& y)
-{
- sub(*this, y, *this);
-}
-
-inline void Integer::operator -= (long y)
-{
- sub(*this, y, *this);
-}
-
-inline void Integer::operator -- ()
-{
- add(*this, -1, *this);
-}
-
-
-
-inline void Integer::operator *= (const Integer& y)
-{
- mul(*this, y, *this);
-}
-
-inline void Integer::operator *= (long y)
-{
- mul(*this, y, *this);
-}
-
-
-inline void Integer::operator &= (const Integer& y)
-{
- and(*this, y, *this);
-}
-
-inline void Integer::operator &= (long y)
-{
- and(*this, y, *this);
-}
-
-inline void Integer::operator |= (const Integer& y)
-{
- or(*this, y, *this);
-}
-
-inline void Integer::operator |= (long y)
-{
- or(*this, y, *this);
-}
-
-
-inline void Integer::operator ^= (const Integer& y)
-{
- xor(*this, y, *this);
-}
-
-inline void Integer::operator ^= (long y)
-{
- xor(*this, y, *this);
-}
-
-
-
-inline void Integer::operator /= (const Integer& y)
-{
- div(*this, y, *this);
-}
-
-inline void Integer::operator /= (long y)
-{
- div(*this, y, *this);
-}
-
-
-inline void Integer::operator %= (const Integer& y)
-{
- mod(*this, y, *this);
-}
-
-inline void Integer::operator %= (long y)
-{
- mod(*this, y, *this);
-}
-
-
-inline void Integer::operator <<= (const Integer& y)
-{
- lshift(*this, y, *this);
-}
-
-inline void Integer::operator <<= (long y)
-{
- lshift(*this, y, *this);
-}
-
-
-inline void Integer::operator >>= (const Integer& y)
-{
- rshift(*this, y, *this);
-}
-
-inline void Integer::operator >>= (long y)
-{
- rshift(*this, y, *this);
-}
-
-#ifdef __GNUG__
-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 ostream& operator << (ostream& s, const Integer& y)
-{
- return s << Itoa(y.rep);
-}
-
-inline long lg(const Integer& x)
-{
- return lg(x.rep);
-}
-
-// constructive operations
-
-#if defined(__GNUG__) && !defined(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
-{
- and(x, y, r);
-}
-
-inline Integer operator & (const Integer& x, long y) return r
-{
- and(x, y, r);
-}
-
-inline Integer operator & (long x, const Integer& y) return r
-{
- and(x, y, r);
-}
-
-inline Integer operator | (const Integer& x, const Integer& y) return r
-{
- or(x, y, r);
-}
-
-inline Integer operator | (const Integer& x, long y) return r
-{
- or(x, y, r);
-}
-
-inline Integer operator | (long x, const Integer& y) return r
-{
- or(x, y, r);
-}
-
-inline Integer operator ^ (const Integer& x, const Integer& y) return r
-{
- xor(x, y, r);
-}
-
-inline Integer operator ^ (const Integer& x, long y) return r
-{
- xor(x, y, r);
-}
-
-inline Integer operator ^ (long x, const Integer& y) return r
-{
- xor(x, y, r);
-}
-
-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; xor(x, y, r); return r;
-}
-
-inline Integer operator ^ (const Integer& x, long y)
-{
- Integer r; xor(x, y, r); return r;
-}
-
-inline Integer operator ^ (long x, const Integer& y)
-{
- Integer r; xor(x, y, r); 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
-#endif
-#endif
diff --git a/gnu/lib/libg++/g++-include/LogNorm.h b/gnu/lib/libg++/g++-include/LogNorm.h
deleted file mode 100644
index 6c7c74cdef1..00000000000
--- a/gnu/lib/libg++/g++-include/LogNorm.h
+++ /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 Dirk Grunwald (grunwald@cs.uiuc.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.
-*/
-#ifndef _LogNormal_h
-#ifdef __GNUG__
-#pragma once
-#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()();
-};
-
-#if defined(__OPTIMIZE__) || defined(USE_LIBGXX_INLINES)
-
-inline void LogNormal::setState()
-{
- double m2 = logMean * logMean;
- pMean = log(m2 / sqrt(logVariance + m2) );
- pVariance = log((sqrt(logVariance + m2)/m2 ));
-}
-
-inline LogNormal::LogNormal(double mean, double variance, RNG *gen)
- : (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
-#endif
diff --git a/gnu/lib/libg++/g++-include/MLCG.h b/gnu/lib/libg++/g++-include/MLCG.h
deleted file mode 100644
index 73791f055ce..00000000000
--- a/gnu/lib/libg++/g++-include/MLCG.h
+++ /dev/null
@@ -1,97 +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 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.
-*/
-#ifndef _MLCG_h
-#define _MLCG_h 1
-#ifdef __GNUG__
-#pragma once
-#pragma interface
-#endif
-
-#include <RNG.h>
-#include <math.h>
-
-//
-// Multiplicative Linear Conguential Generator
-//
-
-class MLCG : public RNG {
- long initialSeedOne;
- long initialSeedTwo;
- long seedOne;
- long seedTwo;
-
-protected:
-
-public:
- MLCG(long seed1 = 0, long seed2 = 1);
- //
- // Return a long-words word of random bits
- //
- virtual unsigned long asLong();
- virtual void reset();
- long seed1();
- void seed1(long);
- long seed2();
- void seed2(long);
- void reseed(long, long);
-};
-
-#if defined(__OPTIMIZE__) || defined(USE_LIBGXX_INLINES)
-
-inline long
-MLCG::seed1()
-{
- return(seedOne);
-}
-
-inline void
-MLCG::seed1(long s)
-{
- initialSeedOne = s;
- reset();
-}
-
-inline long
-MLCG::seed2()
-{
- return(seedTwo);
-}
-
-inline void
-MLCG::seed2(long s)
-{
- initialSeedTwo = s;
- reset();
-}
-
-inline void
-MLCG::reseed(long s1, long s2)
-{
- initialSeedOne = s1;
- initialSeedTwo = s2;
- reset();
-}
-
-#endif
-
-#endif
diff --git a/gnu/lib/libg++/g++-include/Makefile b/gnu/lib/libg++/g++-include/Makefile
deleted file mode 100644
index cf914535d3a..00000000000
--- a/gnu/lib/libg++/g++-include/Makefile
+++ /dev/null
@@ -1,58 +0,0 @@
-# %W% (Berkeley) %G%
-#
-# Cloned from /usr/src/include/Makefile
-# Doing a make install builds /usr/include/g++
-#
-
-all clean cleandir depend lint tags:
-
-FILES= ACG.h AllocRing.h Binomial.h BitSet.h BitString.h \
- Complex.h CursesW.h DiscUnif.h Erlang.h File.h \
- Filebuf.h Fix.h Fix16.h Fix24.h Fmodes.h Geom.h \
- GetOpt.h HypGeom.h Incremental.h Integer.h LogNorm.h \
- MLCG.h NegExp.h Normal.h Obstack.h Pix.h PlotFile.h \
- Poisson.h RNG.h Random.h Rational.h Regex.h RndInt.h \
- SFile.h SmplHist.h SmplStat.h String.h Uniform.h \
- Weibull.h abs.h assert.h bool.h builtin.h compare.h \
- complex.h curses.h file.h filebuf.h generic.h \
- istream.h malloc.h max.h min.h minmax.h new.h open.h \
- osfcn.h ostream.h regex.h std.h strclass.h stream.h \
- streambuf.h swap.h values.h
-
-DIRS= gen
-
-NOOBJ= noobj
-
-INCDIR= /usr/include/g++
-
-install:
- @if [ ! -d ${DESTDIR}${INCDIR} ]; then \
- /bin/rm -f ${DESTDIR}${INCDIR} ; \
- mkdir -p ${DESTDIR}${INCDIR} ; \
- chown root.wheel ${DESTDIR}${INCDIR} ; \
- chmod 755 ${DESTDIR}${INCDIR} ; \
- else \
- true ; \
- fi
- @echo installing ${FILES}
- @-for i in ${FILES}; do \
- cmp -s $$i ${DESTDIR}${INCDIR}/$$i || \
- install -c -o ${BINOWN} -g ${BINGRP} -m 444 $$i \
- ${DESTDIR}${INCDIR}/$$i; \
- done
- @echo installing ${DIRS}
- @-for i in ${DIRS}; do \
- if [ ! -d ${DESTDIR}${INCDIR}/$$i ]; \
- then \
- mkdir ${DESTDIR}${INCDIR}/$$i; \
- fi; \
- chown ${BINOWN}.${BINGRP} ${DESTDIR}${INCDIR}/$$i; \
- chmod 755 ${DESTDIR}${INCDIR}/$$i; \
- (cd $$i; for j in *.*P; do \
- cmp -s $$j ${DESTDIR}${INCDIR}/$$i/$$j || \
- install -c -o ${BINOWN} -g ${BINGRP} -m 444 $$j \
- ${DESTDIR}${INCDIR}/$$i/$$j; \
- done); \
- done
-
-.include <bsd.prog.mk>
diff --git a/gnu/lib/libg++/g++-include/NegExp.h b/gnu/lib/libg++/g++-include/NegExp.h
deleted file mode 100644
index 21a1a18f233..00000000000
--- a/gnu/lib/libg++/g++-include/NegExp.h
+++ /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 Dirk Grunwald (grunwald@cs.uiuc.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.
-*/
-#ifndef _NegativeExpntl_h
-#ifdef __GNUG__
-#pragma once
-#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()();
-};
-
-#if defined(__OPTIMIZE__) || defined(USE_LIBGXX_INLINES)
-
-inline NegativeExpntl::NegativeExpntl(double xmean, RNG *gen)
-: (gen) {
- pMean = xmean;
-}
-
-inline double NegativeExpntl::mean() { return pMean; }
-inline double NegativeExpntl::mean(double x) {
- double t = pMean; pMean = x;
- return t;
-}
-
-#endif
-#endif
diff --git a/gnu/lib/libg++/g++-include/Normal.h b/gnu/lib/libg++/g++-include/Normal.h
deleted file mode 100644
index b8a209eba74..00000000000
--- a/gnu/lib/libg++/g++-include/Normal.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 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.
-*/
-#ifndef _Normal_h
-#ifdef __GNUG__
-#pragma once
-#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()();
-};
-
-#if defined(__OPTIMIZE__) || defined(USE_LIBGXX_INLINES)
-
-inline Normal::Normal(double xmean, double xvariance, RNG *gen)
-: (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
-#endif
diff --git a/gnu/lib/libg++/g++-include/Obstack.h b/gnu/lib/libg++/g++-include/Obstack.h
deleted file mode 100644
index 0cc2e9bb378..00000000000
--- a/gnu/lib/libg++/g++-include/Obstack.h
+++ /dev/null
@@ -1,226 +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 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.
-*/
-
-
-#ifndef _Obstack_h
-#ifdef __GNUG__
-#pragma once
-#pragma interface
-#endif
-#define _Obstack_h 1
-
-#include <std.h>
-
-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
-};
-
-#if defined(__OPTIMIZE__) || defined(USE_LIBGXX_INLINES)
-
-
-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);
- bcopy(data, nextfree, size);
- nextfree += size;
-}
-
-inline void Obstack:: grow(const void* data, int size, char terminator)
-{
- if (nextfree+size+1 > chunklimit)
- newchunk(size+1);
- bcopy(data, nextfree, size);
- nextfree += size;
- *(nextfree)++ = terminator;
-}
-
-inline void Obstack:: grow(const char* s)
-{
- grow((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((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
-
-#endif
diff --git a/gnu/lib/libg++/g++-include/Pix.h b/gnu/lib/libg++/g++-include/Pix.h
deleted file mode 100644
index 0e087967e05..00000000000
--- a/gnu/lib/libg++/g++-include/Pix.h
+++ /dev/null
@@ -1,9 +0,0 @@
-
-#ifndef _Pix_h
-#ifdef __GNUG__
-#pragma once
-#pragma interface
-#endif
-#define _Pix_h 1
-typedef void* Pix;
-#endif
diff --git a/gnu/lib/libg++/g++-include/PlotFile.h b/gnu/lib/libg++/g++-include/PlotFile.h
deleted file mode 100644
index 1a6939641eb..00000000000
--- a/gnu/lib/libg++/g++-include/PlotFile.h
+++ /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 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.
-*/
-
-/*
- a very simple implementation of a class to output unix "plot"
- format plotter files. See corresponding unix man pages for
- more details.
-*/
-
-#ifndef _PlotFile_h
-#ifdef __GNUG__
-#pragma once
-#pragma interface
-#endif
-#define _PlotFile_h
-
-#include <File.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.
-*/
-
-
-class PlotFile : private File
-{
-protected:
- PlotFile& cmd(char c);
- PlotFile& operator << (const int x);
- PlotFile& operator << (const char *s);
-
-public:
-
- PlotFile();
- PlotFile(const char* filename, io_mode m, access_mode a);
- PlotFile(const char* filename, const char* m);
- PlotFile(int filedesc, const io_mode m = io_writeonly);
- PlotFile(FILE* fileptr);
-
- ~PlotFile();
-
- operator void*();
-
- PlotFile& close() { File::close(); return *this; }
- PlotFile& remove() { File::remove(); return *this; }
-
- int filedesc() { return File::filedesc(); }
- const char* name() { return File::name(); }
- void setname(const char* newname) { File::setname(newname); }
- int iocount() { return File::iocount(); }
-
- int rdstate() { return File::rdstate(); }
- int eof() { return File::eof(); }
- int fail() { return File::fail(); }
- int bad() { return File::bad(); }
- int good() { return File::good(); }
-
- // other status queries
-
- int readable() { return File::readable(); }
- int writable() { return File::writable(); }
- int is_open() { return File::is_open(); }
-
- void error() { File::error(); }
- void clear(state_value f = _good) { File::clear(f); }
- void set(state_value f) { File::set(f); }
- void unset(state_value f) { File::unset(f); }
- PlotFile& failif(int cond) { File::failif(cond); return *this; }
- void check_state() { File::check_state(); }
-
- PlotFile& raw() { File::raw(); return *this; }
-
- PlotFile& open(const char* filename, io_mode m, access_mode a);
- PlotFile& open(const char* filename, const char* m);
- PlotFile& open(int filedesc, io_mode m);
- PlotFile& open(FILE* fileptr);
- PlotFile& setbuf(const int buffer_kind); // vals: _IONBF, _IOFBF, _IOLBF
- PlotFile& setbuf(const int size, char* buf);
-
- 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);
-};
-
-
-#endif
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/gnu/lib/libg++/g++-include/Poisson.h b/gnu/lib/libg++/g++-include/Poisson.h
deleted file mode 100644
index aaac6e75ae4..00000000000
--- a/gnu/lib/libg++/g++-include/Poisson.h
+++ /dev/null
@@ -1,60 +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 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.
-*/
-#ifndef _Poisson_h
-#ifdef __GNUG__
-#pragma once
-#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()();
-};
-
-#if defined(__OPTIMIZE__) || defined(USE_LIBGXX_INLINES)
-
-inline Poisson::Poisson(double mean, RNG *gen)
-: (gen) {
- pMean = mean;
-}
-
-inline double Poisson::mean() { return pMean; }
-inline double Poisson::mean(double x) {
- double t = pMean;
- pMean = x;
- return t;
-}
-
-
-#endif
-#endif
diff --git a/gnu/lib/libg++/g++-include/RNG.h b/gnu/lib/libg++/g++-include/RNG.h
deleted file mode 100644
index 414b57f3afe..00000000000
--- a/gnu/lib/libg++/g++-include/RNG.h
+++ /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 Dirk Grunwald (grunwald@cs.uiuc.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.
-*/
-#ifndef _RNG_h
-#define _RNG_h 1
-#ifdef __GNUG__
-#pragma once
-#pragma interface
-#endif
-
-#include <assert.h>
-#include <math.h>
-
-union PrivateRNGSingleType { // used to access floats as unsigneds
- float s;
- unsigned long u;
-};
-
-union PrivateRNGDoubleType { // used to access doubles as unsigneds
- double d;
- unsigned long 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 unsigned long asLong() = 0;
- virtual void reset() = 0;
- //
- // Return random bits converted to either a float or a double
- //
- float asFloat();
- double asDouble();
-};
-
-#if defined(__OPTIMIZE__) || defined(USE_LIBGXX_INLINES)
-
-
-inline 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 );
-}
-
-inline 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 );
-}
-
-#endif
-#endif
diff --git a/gnu/lib/libg++/g++-include/Random.h b/gnu/lib/libg++/g++-include/Random.h
deleted file mode 100644
index 94efa09fc0e..00000000000
--- a/gnu/lib/libg++/g++-include/Random.h
+++ /dev/null
@@ -1,67 +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 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.
-*/
-#ifndef _Random_h
-#ifdef __GNUG__
-#pragma once
-#pragma interface
-#endif
-#define _Random_h 1
-#ifdef __GNUG__
-#pragma once
-#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);
-};
-
-#if defined(__OPTIMIZE__) || defined(USE_LIBGXX_INLINES)
-
-inline Random::Random(RNG *gen)
-{
- pGenerator = gen;
-}
-
-inline RNG *Random::generator()
-{
- return(pGenerator);
-}
-
-inline void Random::generator(RNG *p)
-{
- pGenerator = p;
-}
-
-#endif
-
-#endif
diff --git a/gnu/lib/libg++/g++-include/Rational.h b/gnu/lib/libg++/g++-include/Rational.h
deleted file mode 100644
index 3e7e35f1b73..00000000000
--- a/gnu/lib/libg++/g++-include/Rational.h
+++ /dev/null
@@ -1,270 +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 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.
-*/
-
-#ifndef _Rational_h
-#ifdef __GNUG__
-#pragma once
-#pragma interface
-#endif
-#define _Rational_h 1
-
-#include <Integer.h>
-#include <math.h>
-
-class Rational
-{
-protected:
- Integer num;
- Integer den;
-
- void normalize();
-
-public:
- Rational();
- Rational(double);
- Rational(long n, long d = 1);
- Rational(const Integer& n);
- Rational(const Integer& n, const Integer& d);
- Rational(const Rational&);
-
- ~Rational();
-
- void 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);
-
- void operator += (const Rational& y);
- void operator -= (const Rational& y);
- void operator *= (const Rational& y);
- void operator /= (const Rational& y);
-
-#ifdef __GNUG__
- 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, 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);
-
-
-// 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
-
- volatile void error(const char* msg) const;
- int OK() const;
-
-};
-
-typedef Rational RatTmp; // backwards compatibility
-
-#if defined(__OPTIMIZE__) || defined(USE_LIBGXX_INLINES)
-
-inline Rational::Rational() {}
-inline Rational::~Rational() {}
-
-inline Rational::Rational(const Rational& y) :num(y.num), den(y.den) {}
-
-inline Rational::Rational(const Integer& n) :num(n), den(1) {}
-
-inline Rational::Rational(const Integer& n, const Integer& d) :num(n),den(d)
-{
- normalize();
-}
-
-inline Rational::Rational(long n, long d) :num(n), den(d)
-{
- normalize();
-}
-
-inline void Rational::operator = (const Rational& y)
-{
- num = y.num; den = y.den;
-}
-
-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 void Rational::operator += (const Rational& y)
-{
- add(*this, y, *this);
-}
-
-inline void Rational::operator -= (const Rational& y)
-{
- sub(*this, y, *this);
-}
-
-inline void Rational::operator *= (const Rational& y)
-{
- mul(*this, y, *this);
-}
-
-inline void Rational::operator /= (const Rational& y)
-{
- div(*this, y, *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); }
-
-#ifdef __GNUG__
-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(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
-
-#endif
diff --git a/gnu/lib/libg++/g++-include/Regex.h b/gnu/lib/libg++/g++-include/Regex.h
deleted file mode 100644
index d0cff263f20..00000000000
--- a/gnu/lib/libg++/g++-include/Regex.h
+++ /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 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.
-*/
-
-
-#ifndef _Regex_h
-#ifdef __GNUG__
-#pragma once
-#pragma interface
-#endif
-#define _Regex_h 1
-
-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/gnu/lib/libg++/g++-include/RndInt.h b/gnu/lib/libg++/g++-include/RndInt.h
deleted file mode 100644
index f674796f058..00000000000
--- a/gnu/lib/libg++/g++-include/RndInt.h
+++ /dev/null
@@ -1,169 +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
-and this notice must be preserved on all copies.
-*/
-
-#ifndef _RandomInteger_h
-#ifdef __GNUG__
-#pragma once
-#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);
-
-};
-
-#if defined(__OPTIMIZE__) || defined(USE_LIBGXX_INLINES)
-
-inline RandomInteger::RandomInteger(long low, long high, RNG *gen)
- : pLow((low < high) ? low : high),
- pHigh((low < high) ? high : low),
- pGenerator(gen)
-{}
-
-inline RandomInteger::RandomInteger(long high, RNG *gen)
- : pLow((0 < high) ? 0 : high),
- pHigh((0 < high) ? high : 0),
- pGenerator(gen)
-{}
-
-
-inline RandomInteger::RandomInteger(RNG *gen)
- : pLow(0),
- pHigh(1),
- pGenerator(gen)
-{}
-
-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
-
-#endif
diff --git a/gnu/lib/libg++/g++-include/SFile.h b/gnu/lib/libg++/g++-include/SFile.h
deleted file mode 100644
index 598078ed8fe..00000000000
--- a/gnu/lib/libg++/g++-include/SFile.h
+++ /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)
-
-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.
-*/
-
-#ifndef _SFile_h
-#ifdef __GNUG__
-#pragma once
-#pragma interface
-#endif
-#define _SFile_h 1
-
-#include <File.h>
-
-class SFile: public File
-{
-protected:
- int sz; // unit size for structured binary IO
-
-public:
- SFile();
- SFile(const char* filename, int size, io_mode m, access_mode a);
- SFile(const char* filename, int size, const char* m);
- SFile(int filedesc, int size, io_mode m);
- SFile(FILE* fileptr, int size);
-
- ~SFile();
-
- int size();
- int setsize(int s);
-
- SFile& get(void* x);
- SFile& put(void* x);
- SFile& operator[](long i);
-};
-
-#if defined(__OPTIMIZE__) || defined(USE_LIBGXX_INLINES)
-
-
-inline int SFile::size()
-{
- return sz;
-}
-
-inline int SFile::setsize(int s)
-{
- int old = sz;
- sz = s;
- return old;
-}
-
-inline SFile& SFile::get(void* x)
-{
- read(x, sz, 1); return *this;
-}
-
-inline SFile& SFile::put(void* x)
-{
- write(x, sz, 1); return *this;
-}
-
-inline SFile& SFile::operator[](long i)
-{
- seek(i * sz, 0); return *this;
-}
-
-
-#endif
-
-#endif
diff --git a/gnu/lib/libg++/g++-include/SmplHist.h b/gnu/lib/libg++/g++-include/SmplHist.h
deleted file mode 100644
index ed1fb5d1364..00000000000
--- a/gnu/lib/libg++/g++-include/SmplHist.h
+++ /dev/null
@@ -1,82 +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 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.
-*/
-
-#ifndef SampleHistogram_h
-#ifdef __GNUG__
-#pragma once
-#pragma interface
-#endif
-#define SampleHistogram_h 1
-
-#include <stream.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&);
-
-};
-
-#if defined(__OPTIMIZE__) || defined(USE_LIBGXX_INLINES)
-
- 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
-
-#endif
diff --git a/gnu/lib/libg++/g++-include/SmplStat.h b/gnu/lib/libg++/g++-include/SmplStat.h
deleted file mode 100644
index 6aea14aef08..00000000000
--- a/gnu/lib/libg++/g++-include/SmplStat.h
+++ /dev/null
@@ -1,73 +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 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.
-*/
-#ifndef SampleStatistic_h
-#ifdef __GNUG__
-#pragma once
-#pragma interface
-#endif
-#define SampleStatistic_h 1
-
-#include <builtin.h>
-
-class SampleStatistic {
-protected:
- int n;
- double x;
- double x2;
- double minValue, maxValue;
-
- public :
-
- 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);
-
-#if defined(__OPTIMIZE__) || defined(USE_LIBGXX_INLINES)
-
- inline SampleStatistic:: SampleStatistic(){ reset();}
- inline int SampleStatistic:: samples() {return(n);}
- inline double SampleStatistic:: min() {return(minValue);}
- inline double SampleStatistic:: max() {return(maxValue);}
-
-#endif
-#endif
diff --git a/gnu/lib/libg++/g++-include/String.h b/gnu/lib/libg++/g++-include/String.h
deleted file mode 100644
index 871b9a2d54d..00000000000
--- a/gnu/lib/libg++/g++-include/String.h
+++ /dev/null
@@ -1,1341 +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 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.
-*/
-
-#if defined(SHORT_NAMES) || defined(VMS)
-#define re_compile_pattern recmppat
-#define re_pattern_buffer repatbuf
-#define re_registers reregs
-#endif
-
-#ifndef _String_h
-#ifdef __GNUG__
-#pragma once
-#pragma interface
-#endif
-#define _String_h 1
-
-#include <stream.h>
-#include <Regex.h>
-
-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*, StrRep*);
-StrRep* Sresize(StrRep*, int);
-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(StrRep*, StrRep*);
-StrRep* Supcase(StrRep*, StrRep*);
-StrRep* Sdowncase(StrRep*, StrRep*);
-StrRep* Scapitalize(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(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();
-
- void operator = (const String& y);
- void operator = (const SubString& y);
- void operator = (const char* t);
- void 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
-
- 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();
-
- void operator = (const String& y);
- void operator = (const char* y);
- void operator = (char c);
- void operator = (const SubString& y);
-
-// concatenation
-
- void operator += (const String& y);
- void operator += (const SubString& y);
- void operator += (const char* t);
- void 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 void cat(const String&, const String&, String&);
- friend void cat(const String&, const SubString&, String&);
- friend void cat(const String&, const char*, String&);
- friend void cat(const String&, char, String&);
-
- friend void cat(const SubString&, const String&, String&);
- friend void cat(const SubString&, const SubString&, String&);
- friend void cat(const SubString&, const char*, String&);
- friend void cat(const SubString&, char, String&);
-
- friend void cat(const char*, const String&, String&);
- friend void cat(const char*, const SubString&, String&);
- friend void cat(const char*, const char*, String&);
- friend 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 void cat(const String&,const String&, const String&,String&);
- friend void cat(const String&,const String&,const SubString&,String&);
- friend void cat(const String&,const String&, const char*, String&);
- friend void cat(const String&,const String&, char, String&);
- friend void cat(const String&,const SubString&,const String&,String&);
- friend void cat(const String&,const SubString&,const SubString&,String&);
- friend void cat(const String&,const SubString&, const char*, String&);
- friend void cat(const String&,const SubString&, char, String&);
- friend void cat(const String&,const char*, const String&, String&);
- friend void cat(const String&,const char*, const SubString&, String&);
- friend void cat(const String&,const char*, const char*, String&);
- friend void cat(const String&,const char*, char, String&);
-
- friend void cat(const char*, const String&, const String&,String&);
- friend void cat(const char*,const String&,const SubString&,String&);
- friend void cat(const char*,const String&, const char*, String&);
- friend void cat(const char*,const String&, char, String&);
- friend void cat(const char*,const SubString&,const String&,String&);
- friend void cat(const char*,const SubString&,const SubString&,String&);
- friend void cat(const char*,const SubString&, const char*, String&);
- friend void cat(const char*,const SubString&, char, String&);
- friend void cat(const char*,const char*, const String&, String&);
- friend void cat(const char*,const char*, const SubString&, String&);
- friend void cat(const char*,const char*, const char*, String&);
- friend 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 String reverse(const String& x);
- friend String upcase(const String& x);
- friend String downcase(const String& x);
- friend String capitalize(const String& x);
-
-// in-place versions of above
-
- void reverse();
- void upcase();
- void downcase();
- void capitalize();
-
-// element extraction
-
- char& operator [] (int i);
- char elem(int i) const;
- char firstchar() const;
- char lastchar() const;
-
-// conversion
-
- operator const char*() const;
- const char* chars() const;
-
-
-// IO
-
- friend 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
-
- int length() const;
- int empty() const;
-
-// preallocate some space for String
- void alloc(int newsize);
-
-// report current allocation (not length!)
-
- int allocation() const;
-
-
- volatile 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;
-
-// other inlines
-
-String operator + (const String& x, const String& y);
-String operator + (const String& x, const SubString& y);
-String operator + (const String& x, const char* y);
-String operator + (const String& x, char y);
-String operator + (const SubString& x, const String& y);
-String operator + (const SubString& x, const SubString& y);
-String operator + (const SubString& x, const char* y);
-String operator + (const SubString& x, char y);
-String operator + (const char* x, const String& y);
-String operator + (const char* x, const SubString& y);
-
-int operator==(const String& x, const String& y);
-int operator!=(const String& x, const String& y);
-int operator> (const String& x, const String& y);
-int operator>=(const String& x, const String& y);
-int operator< (const String& x, const String& y);
-int operator<=(const String& x, const String& y);
-int operator==(const String& x, const SubString& y);
-int operator!=(const String& x, const SubString& y);
-int operator> (const String& x, const SubString& y);
-int operator>=(const String& x, const SubString& y);
-int operator< (const String& x, const SubString& y);
-int operator<=(const String& x, const SubString& y);
-int operator==(const String& x, const char* t);
-int operator!=(const String& x, const char* t);
-int operator> (const String& x, const char* t);
-int operator>=(const String& x, const char* t);
-int operator< (const String& x, const char* t);
-int operator<=(const String& x, const char* t);
-int operator==(const SubString& x, const String& y);
-int operator!=(const SubString& x, const String& y);
-int operator> (const SubString& x, const String& y);
-int operator>=(const SubString& x, const String& y);
-int operator< (const SubString& x, const String& y);
-int operator<=(const SubString& x, const String& y);
-int operator==(const SubString& x, const SubString& y);
-int operator!=(const SubString& x, const SubString& y);
-int operator> (const SubString& x, const SubString& y);
-int operator>=(const SubString& x, const SubString& y);
-int operator< (const SubString& x, const SubString& y);
-int operator<=(const SubString& x, const SubString& y);
-int operator==(const SubString& x, const char* t);
-int operator!=(const SubString& x, const char* t);
-int operator> (const SubString& x, const char* t);
-int operator>=(const SubString& x, const char* t);
-int operator< (const SubString& x, const char* t);
-int operator<=(const SubString& x, const char* t);
-
-#if defined(__OPTIMIZE__) || defined(USE_LIBGXX_INLINES)
-
-
-// status reports, needed before defining other things
-
-inline 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 void String::alloc(int newsize) { rep = Sresize(rep, newsize); }
-
-inline 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 void String::operator = (const String& y)
-{
- rep = Scopy(rep, y.rep);
-}
-
-inline void String::operator=(const char* t)
-{
- rep = Salloc(rep, t, -1, -1);
-}
-
-inline void String::operator=(const SubString& y)
-{
- rep = Salloc(rep, y.chars(), y.length(), y.length());
-}
-
-inline void String::operator=(char c)
-{
- rep = Salloc(rep, &c, 1, 1);
-}
-
-
-inline void SubString::operator = (const char* ys)
-{
- assign(0, ys);
-}
-
-inline void SubString::operator = (char ch)
-{
- assign(0, &ch, 1);
-}
-
-inline void SubString::operator = (const String& y)
-{
- assign(y.rep, y.chars(), y.length());
-}
-
-inline void SubString::operator = (const SubString& y)
-{
- assign(y.S.rep, y.chars(), y.length());
-}
-
-// 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 void String::operator +=(const String& y)
-{
- cat(*this, y, *this);
-}
-
-inline void String::operator +=(const SubString& y)
-{
- cat(*this, y, *this);
-}
-
-inline void String::operator += (const char* y)
-{
- cat(*this, y, *this);
-}
-
-inline void String:: operator +=(char y)
-{
- cat(*this, y, *this);
-}
-
-// constructive concatenation
-
-#if defined(__GNUG__) && !defined(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 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, 0, 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 String::operator const char*() const
-{
- return str(chars());
-}
-
-inline ostream& operator<<(ostream& s, const String& x)
-{
-#ifdef VMS
- s << x.chars(); return s;
-#else
- s.put(x.chars()); return s;
-#endif
-
-}
-
-// 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
-
-#endif
diff --git a/gnu/lib/libg++/g++-include/Uniform.h b/gnu/lib/libg++/g++-include/Uniform.h
deleted file mode 100644
index 5d896e8f0cf..00000000000
--- a/gnu/lib/libg++/g++-include/Uniform.h
+++ /dev/null
@@ -1,81 +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 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.
-*/
-#ifndef _Uniform_h
-#ifdef __GNUG__
-#pragma once
-#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()();
-};
-
-
-#if defined(__OPTIMIZE__) || defined(USE_LIBGXX_INLINES)
-
-inline Uniform::Uniform(double low, double high, RNG *gen):(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
-#endif
diff --git a/gnu/lib/libg++/g++-include/Weibull.h b/gnu/lib/libg++/g++-include/Weibull.h
deleted file mode 100644
index 6ce8eabf8bc..00000000000
--- a/gnu/lib/libg++/g++-include/Weibull.h
+++ /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 Dirk Grunwald (grunwald@cs.uiuc.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.
-*/
-#ifndef _Weibull_h
-#ifdef __GNUG__
-#pragma once
-#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()();
-};
-
-#if defined(__OPTIMIZE__) || defined(USE_LIBGXX_INLINES)
-
-inline void Weibull::setState() {
- pInvAlpha = 1.0 / pAlpha;
-}
-
-inline Weibull::Weibull(double alpha, double beta, RNG *gen) : (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
-#endif
diff --git a/gnu/lib/libg++/g++-include/abs.h b/gnu/lib/libg++/g++-include/abs.h
deleted file mode 100644
index 8c2c8f98ced..00000000000
--- a/gnu/lib/libg++/g++-include/abs.h
+++ /dev/null
@@ -1 +0,0 @@
-#include <builtin.h>
diff --git a/gnu/lib/libg++/g++-include/bool.h b/gnu/lib/libg++/g++-include/bool.h
deleted file mode 100644
index e843aa9c471..00000000000
--- a/gnu/lib/libg++/g++-include/bool.h
+++ /dev/null
@@ -1,10 +0,0 @@
-
-#ifndef _bool_h
-#ifdef __GNUG__
-#pragma once
-#endif
-#define _bool_h 1
-
-enum bool { FALSE = 0, TRUE = 1 };
-
-#endif
diff --git a/gnu/lib/libg++/g++-include/builtin.h b/gnu/lib/libg++/g++-include/builtin.h
deleted file mode 100644
index 904059b8af8..00000000000
--- a/gnu/lib/libg++/g++-include/builtin.h
+++ /dev/null
@@ -1,276 +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 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.
-*/
-
-/*
- arithmetic, etc. functions on built in types
-*/
-
-
-#ifndef _builtin_h
-#ifdef __GNUG__
-#pragma once
-#pragma interface
-#endif
-#define _builtin_h 1
-
-
-typedef void (*one_arg_error_handler_t)(const char*);
-typedef void (*two_arg_error_handler_t)(const char*, const char*);
-
-
-
-#include <stddef.h>
-#include <std.h>
-#include <math.h>
-
-long gcd(long, long);
-long lg(unsigned long);
-double pow(double, long);
-long pow(long, long);
-
-double start_timer();
-double return_elapsed_time(double last_time = 0.0);
-
-char* itoa(long x, int base = 10, int width = 0);
-char* itoa(unsigned long x, int base = 10, int width = 0);
-#ifdef __GNUG__
-char* itoa(long long x, int base = 10, int width = 0);
-char* itoa(unsigned long long x, int base = 10, int width = 0);
-#endif
-char* dtoa(double x, char cvt = 'g', int width = 0, int prec = 6);
-
-char* hex(long x, int width = 0);
-char* hex(unsigned long x, int width = 0);
-char* hex(int x, int width = 0);
-char* hex(short x, int width = 0);
-char* hex(unsigned int x, int width = 0);
-char* hex(unsigned short x, int width = 0);
-
-char* oct(long x, int width = 0);
-char* oct(unsigned long x, int width = 0);
-char* oct(int x, int width = 0);
-char* oct(short x, int width = 0);
-char* oct(unsigned int x, int width = 0) ;
-char* oct(unsigned short x, int width = 0);
-
-char* dec(long x, int width = 0);
-char* dec(unsigned long x, int width = 0);
-char* dec(int x, int width = 0);
-char* dec(short x, int width = 0);
-char* dec(unsigned int x, int width = 0) ;
-char* dec(unsigned short x, int width = 0);
-
-char* form(const char* fmt ...);
-char* chr(char ch, int width = 0);
-char* str(const char* s, int width = 0);
-
-unsigned int hashpjw(const char*);
-unsigned int multiplicativehash(int);
-unsigned int foldhash(double);
-
-extern void default_one_arg_error_handler(const char*);
-extern void default_two_arg_error_handler(const char*, const char*);
-
-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);
-
-
-double abs(double arg);
-float abs(float arg);
-short abs(short arg);
-long abs(long arg);
-int sign(long arg);
-int sign(double arg);
-long sqr(long arg);
-double sqr(double arg);
-int even(long arg);
-int odd(long arg);
-long lcm(long x, long y);
-void setbit(long& x, long b);
-void clearbit(long& x, long b);
-int testbit(long x, long b);
-
-signed char min(signed char a, signed char b);
-unsigned char min(unsigned char a, unsigned char b);
-
-signed short min(signed short a, signed short b);
-unsigned short min(unsigned short a, unsigned short b);
-
-signed int min(signed int a, signed int b);
-unsigned int min(unsigned int a, unsigned int b);
-
-signed long min(signed long a, signed long b);
-unsigned long min(unsigned long a, unsigned long b);
-
-float min(float a, float b);
-
-double min(double a, double b);
-
-signed char max(signed char a, signed char b);
-unsigned char max(unsigned char a, unsigned char b);
-
-signed short max(signed short a, signed short b);
-unsigned short max(unsigned short a, unsigned short b);
-
-signed int max(signed int a, signed int b);
-unsigned int max(unsigned int a, unsigned int b);
-
-signed long max(signed long a, signed long b);
-unsigned long max(unsigned long a, unsigned long b);
-
-float max(float a, float b);
-
-double max(double a, double b);
-
-#if defined(__OPTIMIZE__) || defined(USE_LIBGXX_INLINES)
-
-
-inline double abs(double arg)
-{
- return (arg < 0.0)? -arg : arg;
-}
-
-inline float abs(float arg)
-{
- return (arg < 0.0)? -arg : arg;
-}
-
-inline short abs(short arg)
-{
- return (arg < 0)? -arg : arg;
-}
-
-inline long abs(long 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;
-}
-
-inline double sqr(double arg)
-{
- return arg * arg;
-}
-
-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);
-}
-
-inline char* hex(int x, int width = 0) { return hex(long(x), width); }
-inline char* hex(short x, int width = 0) { return hex(long(x), width); }
-inline char* hex(unsigned int x, int width = 0)
-{ return hex((unsigned long)(x), width); }
-inline char* hex(unsigned short x, int width = 0)
-{ return hex((unsigned long)(x), width); }
-
-inline char* oct(int x, int width = 0) { return oct(long(x), width); }
-inline char* oct(short x, int width = 0) { return oct(long(x), width); }
-inline char* oct(unsigned int x, int width = 0)
-{ return oct((unsigned long)(x), width); }
-inline char* oct(unsigned short x, int width = 0)
-{ return oct((unsigned long)(x), width); }
-
-inline char* dec(int x, int width = 0) { return dec(long(x), width); }
-inline char* dec(short x, int width = 0) { return dec(long(x), width); }
-inline char* dec(unsigned int x, int width = 0)
-{ return dec((unsigned long)(x), width); }
-inline char* dec(unsigned short x, int width = 0)
-{ return dec((unsigned long)(x), width); }
-
-inline signed char min(signed char a, signed char b) { return (a < b)?a:b;}
-inline unsigned char min(unsigned char a, unsigned char b) {return (a < b)?a:b;}
-
-inline signed short min(signed short a, signed short b) {return (a < b) ?a:b;}
-inline unsigned short min(unsigned short a, unsigned short b) {return (a < b)?a:b;}
-
-inline signed int min(signed int a, signed int b) {return (a < b)?a:b;}
-inline unsigned int min(unsigned int a, unsigned int b) {return (a < b)?a:b;}
-
-inline signed long min(signed long a, signed 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 signed char max(signed char a, signed char b) { return (a > b)?a:b;}
-inline unsigned char max(unsigned char a, unsigned char b) {return (a > b)?a:b;}
-
-inline signed short max(signed short a, signed short b) {return (a > b) ?a:b;}
-inline unsigned short max(unsigned short a, unsigned short b) {return (a > b)?a:b;}
-
-inline signed int max(signed int a, signed int b) {return (a > b)?a:b;}
-inline unsigned int max(unsigned int a, unsigned int b) {return (a > b)?a:b;}
-
-inline signed long max(signed long a, signed 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
-
-#endif
diff --git a/gnu/lib/libg++/g++-include/compare.h b/gnu/lib/libg++/g++-include/compare.h
deleted file mode 100644
index e298e2f1957..00000000000
--- a/gnu/lib/libg++/g++-include/compare.h
+++ /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 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.
-*/
-
-#ifndef _compare_h
-#ifdef __GNUG__
-#pragma once
-#pragma interface
-#endif
-#define _compare_h 1
-
-#include <builtin.h>
-
-int compare(int a, int b);
-int compare(short a, short b);
-int compare(char a, char 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(float a, float b);
-int compare(double a, double b);
-int compare(const char* a, const char* b);
-
-#if defined(__OPTIMIZE__) || defined(USE_LIBGXX_INLINES)
-
-inline int compare(int a, int b)
-{
- return a - b;
-}
-
-inline int compare(short a, short b)
-{
- return a - b;
-}
-
-inline int compare(char a, 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
-#endif
diff --git a/gnu/lib/libg++/g++-include/complex.h b/gnu/lib/libg++/g++-include/complex.h
deleted file mode 100644
index 1411c22f0c0..00000000000
--- a/gnu/lib/libg++/g++-include/complex.h
+++ /dev/null
@@ -1,9 +0,0 @@
-#ifndef _complex_h
-#ifdef __GNUG__
-#pragma once
-#endif
-#define _complex_h
-#define __ATT_complex__
-#include <Complex.h>
-typedef class Complex complex;
-#endif
diff --git a/gnu/lib/libg++/g++-include/fcntl.h b/gnu/lib/libg++/g++-include/fcntl.h
deleted file mode 100644
index 8fab80af867..00000000000
--- a/gnu/lib/libg++/g++-include/fcntl.h
+++ /dev/null
@@ -1,31 +0,0 @@
-// $Id: fcntl.h,v 1.2 1993/08/02 17:22:07 mycroft Exp $
-
-#ifndef fcntl_h
-
-extern "C" {
-
-#ifdef __fcntl_h_recursive
-#include_next <fcntl.h>
-#else
-#define fcntl __hide_fcntl
-#define open __hide_open
-#define creat __hide_creat
-
-#define __fcntl_h_recursive
-#include <_G_config.h>
-#include_next <fcntl.h>
-
-#undef fcntl
-#undef open
-#undef creat
-
-#define fcntl_h 1
-
-int fcntl(int, int, ...);
-int creat _G_ARGS((const char*, unsigned short int));
-
-int open _G_ARGS((const char*, int, ...));
-
-#endif
-}
-#endif
diff --git a/gnu/lib/libg++/g++-include/file.h b/gnu/lib/libg++/g++-include/file.h
deleted file mode 100644
index ca112456ea1..00000000000
--- a/gnu/lib/libg++/g++-include/file.h
+++ /dev/null
@@ -1,8 +0,0 @@
-
-#ifndef file_h
-#ifdef __GNUG__
-#pragma once
-#pragma interface
-#endif
-#include <sys/file.h>
-#endif
diff --git a/gnu/lib/libg++/g++-include/filebuf.h b/gnu/lib/libg++/g++-include/filebuf.h
deleted file mode 100644
index 9cf35ccadb0..00000000000
--- a/gnu/lib/libg++/g++-include/filebuf.h
+++ /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 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.
-*/
-
-#ifndef _filebuf_h
-#ifdef __GNUG__
-#pragma once
-#pragma interface
-#endif
-#define _filebuf_h 1
-
-#include <streambuf.h>
-#include <stdio.h>
-
-class filebuf: public streambuf
-{
-public:
- int fd;
- char opened;
-
- int overflow(int c = EOF);
- int underflow();
-
- filebuf();
- filebuf(int newfd);
- filebuf(int newfd, char* buf, int buflen);
- filebuf(const char* filename, io_mode m, access_mode a);
- filebuf(const char* filename, const char* m);
- filebuf(int filedesc, io_mode m);
- filebuf(FILE* fileptr);
-
- ~filebuf();
-
- streambuf* open(const char* name, open_mode m);
- streambuf* open(const char* filename, io_mode m, access_mode a);
- streambuf* open(const char* filename, const char* m);
- streambuf* open(int filedesc, io_mode m);
- streambuf* open(FILE* fileptr);
- int is_open();
- int close();
-};
-
-
-#endif
diff --git a/gnu/lib/libg++/g++-include/generic.h b/gnu/lib/libg++/g++-include/generic.h
deleted file mode 100644
index 743a26dcbcb..00000000000
--- a/gnu/lib/libg++/g++-include/generic.h
+++ /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 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.
-*/
-
-#ifndef generic_h
-#ifdef __GNUG__
-#pragma once
-#pragma interface
-#endif
-#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/gnu/lib/libg++/g++-include/grp.h b/gnu/lib/libg++/g++-include/grp.h
deleted file mode 100644
index d5ccbb7aa3d..00000000000
--- a/gnu/lib/libg++/g++-include/grp.h
+++ /dev/null
@@ -1,43 +0,0 @@
-// $Id: grp.h,v 1.3 1993/08/14 22:07:30 mycroft Exp $
-
-#ifndef grp_h
-
-extern "C" {
-
-#ifdef __grp_h_recursive
-#include_next <grp.h>
-#else
-#define __grp_h_recursive
-
-#include <stdio.h>
-
-#define getgrent c_proto_getgrent
-#define getgrgid c_proto_getgrgid
-#define getgrnam c_proto_getgrnam
-#define setgrent c_proto_setgrent
-#define endgrent c_proto_endgrent
-#define fgetgrent c_proto_fgetgrent
-
-#include_next <grp.h>
-
-#define grp_h 1
-
-#undef getgrent
-#undef getgrgid
-#undef getgrnam
-
-extern struct group* getgrent();
-extern struct group* fgetgrent(FILE*);
-extern struct group* getgrgid(int);
-extern struct group* getgrnam(const char*);
-#if defined(__OSF1__) || defined (__NetBSD__)
-extern int setgrent();
-#else
-extern void setgrent();
-#endif
-extern void endgrent();
-
-#endif
-}
-
-#endif
diff --git a/gnu/lib/libg++/g++-include/istream.h b/gnu/lib/libg++/g++-include/istream.h
deleted file mode 100644
index 1fa10fe594a..00000000000
--- a/gnu/lib/libg++/g++-include/istream.h
+++ /dev/null
@@ -1,259 +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 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.
-*/
-
-/* *** Version 1.2 -- nearly 100% AT&T 1.2 compatible *** */
-
-/* istream.h now separately includable */
-
-#ifndef _istream_h
-#ifdef __GNUG__
-#pragma once
-#pragma interface
-#endif
-#define _istream_h 1
-
-
-#include <File.h>
-#include <streambuf.h>
-#include <filebuf.h>
-#include <Filebuf.h>
-
-class whitespace // a class used only to input and
-{ // discard white space characters
- char filler;
-};
-
-class ostream;
-
-class istream
-{
- friend void eatwhite(istream& s);
-protected:
- streambuf* bp;
- state_value state; // _good/_eof/_fail/_bad
- ostream* tied_to;
- char skipws;
- char ownbuf;
- void _flush();
- char* readline (int chunk_number, char terminator);
-
-public:
- istream(const char* filename, io_mode m, access_mode a,
- int sk=1, ostream* t = 0);
- istream(const char* filename, const char* m,
- int sk=1, ostream* t = 0);
- istream(int filedesc, io_mode m, int sk=1, ostream* t = 0);
- istream(FILE* fileptr, int sk=1, ostream* t = 0);
- istream(int sz, char* buf, int sk=1, ostream* t = 0);
- istream(int filedesc, int sk=1, ostream* t = 0);
- istream(int filedesc, char* buf, int buflen,
- int sk, ostream* t = 0);
- istream(streambuf* s, int sk=1, ostream* t = 0);
-
- ~istream();
-
- istream& open(const char* filename, io_mode m, access_mode a);
- istream& open(const char* filename, const char* m);
- istream& open(int filedesc, io_mode m);
- istream& open(FILE* fileptr);
- istream& open(const char* filenam, open_mode m);
-
- istream& close();
-
- ostream* tie(ostream* s);
- int skip(int);
-
-// stream status
-
- int rdstate();
- int eof();
- int fail();
- int bad();
- int good();
-
-// other status queries
-
- int readable();
- int writable();
- int is_open();
-
- operator void*();
- int operator !();
-
- const char* name();
-
- char* bufptr();
-
-// error handling
-
- void error();
- void clear(state_value f = _good); // poorly named
- void set(state_value f); // set corresponding bit
- void unset(state_value f); // clear corresponding bit
- istream& failif(int cond);
-
-// unformatted IO
-
- istream& get(char& c);
- istream& unget(char c);
- istream& putback(char c); // a synonym for unget
-
- istream& get (char* s, int n, char terminator = '\n');
- istream& getline(char* s, int n, char terminator = '\n');
- istream& gets (char **s, char terminator = '\n');
-
-
- istream& operator >> (char& c);
- istream& operator >> (short& n);
- istream& operator >> (unsigned short& n);
- istream& operator >> (int& n);
- istream& operator >> (unsigned int& n);
- istream& operator >> (long& n);
- istream& operator >> (unsigned long& n);
-#ifdef __GNUG__
- istream& operator >> (long long& n);
- istream& operator >> (unsigned long long& n);
-#endif
- istream& operator >> (float& n);
- istream& operator >> (double& n);
- istream& operator >> (char* s);
- istream& operator >> (whitespace& w);
-};
-
-// pre-declared streams
-
-extern istream cin; // stdin
-
-extern whitespace WS; // for convenience
-
-#if defined(__OPTIMIZE__) || defined(USE_LIBGXX_INLINES)
-
-
-inline void istream::clear(state_value flag)
-{
- state = flag;
-}
-
-inline void istream::set(state_value flag)
-{
- state = state_value(int(state) | int(flag));
-}
-
-inline void istream::unset(state_value flag)
-{
- state = state_value(int(state) & ~int(flag));
-}
-
-inline int istream::rdstate()
-{
- return int(state);
-}
-
-inline int istream::good()
-{
- return state == _good;
-}
-
-inline int istream::eof()
-{
- return int(state) & int(_eof);
-}
-
-inline int istream::fail()
-{
- return int(state) & int(_fail);
-}
-
-inline int istream::bad()
-{
- return int(state) & int(_bad);
-}
-
-inline istream::operator void*()
-{
- return (state == _good)? this : 0;
-}
-
-inline int istream::operator !()
-{
- return (state != _good);
-}
-
-inline istream& istream::failif(int cond)
-{
- if (cond) set(_fail); return *this;
-}
-
-inline int istream::is_open()
-{
- return bp->is_open();
-}
-
-inline int istream::readable()
-{
- return (bp != 0) && (bp->is_open()) && (state == _good);
-}
-
-inline int istream::writable()
-{
- return 0;
-}
-
-
-inline char* istream::bufptr()
-{
- return bp->base;
-}
-
-
-inline istream& istream::close()
-{
- bp->close(); return *this;
-}
-
-
-inline int istream::skip(int sk)
-{
- int was = skipws; skipws = sk; return was;
-}
-
-
-inline istream& istream::unget(char c)
-{
- if (bp->sputbackc(c) == EOF) set(_fail); return *this;
-}
-
-inline istream& istream::putback(char c)
-{
- if (bp->sputbackc(c) == EOF) set(_fail); return *this;
-}
-
-inline void eatwhite(istream& s)
-{
- s >> WS;
-}
-
-#endif
-
-
-#endif
diff --git a/gnu/lib/libg++/g++-include/malloc.h b/gnu/lib/libg++/g++-include/malloc.h
deleted file mode 100644
index dff79ed6b0e..00000000000
--- a/gnu/lib/libg++/g++-include/malloc.h
+++ /dev/null
@@ -1 +0,0 @@
-#include <std.h>
diff --git a/gnu/lib/libg++/g++-include/math-68881.h b/gnu/lib/libg++/g++-include/math-68881.h
deleted file mode 100644
index f57494d4641..00000000000
--- a/gnu/lib/libg++/g++-include/math-68881.h
+++ /dev/null
@@ -1,518 +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). *
-* *
-* $Id: math-68881.h,v 1.1 1993/08/14 22:38:25 mycroft Exp $ *
-* *
-\******************************************************************/
-
-/* If you find this in GCC,
- please send bug reports to bug-gcc@prep.ai.mit.edu. */
-
-/* Changed by Richard Stallman: % 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. */
-
-#include <errno.h>
-
-#ifndef 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
-#endif
-
-__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
-hypot (const double x, const double y)
-{
- return sqrt (x*x + y*y);
-}
-
-__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 %!,%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 static const 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 static const 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 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/gnu/lib/libg++/g++-include/math.h b/gnu/lib/libg++/g++-include/math.h
deleted file mode 100644
index db39f3e00b4..00000000000
--- a/gnu/lib/libg++/g++-include/math.h
+++ /dev/null
@@ -1,223 +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, 675 Mass Ave, Cambridge, MA 02139, USA.
-
- $Id: math.h,v 1.2 1993/08/02 17:22:08 mycroft Exp $
-*/
-
-
-#ifndef _math_h
-#ifdef __GNUG__
-#pragma interface
-#endif
-#define _math_h 1
-
-#if defined(hp300) && defined(__HAVE_FPU__)
-#define __HAVE_68881__ 1
-#endif
-
-#if defined(masscomp)
-#define __HAVE_68881__ 1
-#endif
-
-#ifdef __HAVE_68881__ /* MC68881/2 Floating-Point Coprocessor */
-extern "C" { /* fill in what we've left out */
-#include <math-68881.h>
-
-double acosh(double);
-double asinh(double);
-double cbrt(double);
-double copysign(double,double);
-double erf(double);
-double erfc(double);
-double finite(double);
-double gamma(double);
-double hypot(double,double);
-double infnan(int);
-int isinf(double);
-int isnan(double);
-double j0(double);
-double j1(double);
-double jn(int, double);
-double lgamma(double);
-double y0(double);
-double y1(double);
-double yn(int, double);
-
-double aint(double);
-double anint(double);
-int irint(double);
-int nint(double);
-}
-/* Please add inline asm code for other machines here! */
-#else
-extern "C" {
-
-#include <_G_config.h>
-
-double acos(double);
-double acosh(double);
-double asin(double);
-double asinh(double);
-double atan(double);
-double atan2(double, double);
-double atanh(double);
-double cbrt(double);
-double ceil(double);
-double copysign(double,double);
-double cos(double);
-double cosh(double);
-double drem(double,double);
-double erf(double);
-double erfc(double);
-double exp(double);
-double expm1(double);
-double fabs(double);
-int finite(double);
-double floor(double);
-double fmod(double, double);
-double frexp(double, int*);
-double gamma(double);
-double hypot(double,double);
-double infnan(int);
-#if !defined(sequent) && !defined(DGUX) &&!defined(sony) && !defined(masscomp) && !defined(hpux)
-/* see below */
-int isinf(double);
-int isnan(double);
-#endif
-double j0(double);
-double j1(double);
-double jn(int, double);
-double ldexp(double, int);
-double lgamma(double);
-double log(double);
-double log10(double);
-double log1p(double);
-double logb(double);
-double modf(double, double*);
-double pow(double, double);
-double rint(double);
-double scalb _G_ARGS((double, int));
-double sin(double);
-double sinh(double);
-double sqrt(double);
-double tan(double);
-double tanh(double);
-double y0(double);
-double y1(double);
-double yn(int, double);
-
-double aint(double);
-double anint(double);
-int irint(double);
-int nint(double);
-}
-
-#endif
-
-/* libg++ doesn't use this since it is not available on some systems */
-
-/* the following ifdef is just for compiling OOPS */
-
-#ifndef DONT_DECLARE_EXCEPTION
-struct libm_exception
-{
- int type;
- char* name;
- double arg1, arg2, retval;
-};
-
-#define DOMAIN 1
-#define SING 2
-#define OVERFLOW 3
-#define UNDERFLOW 4
-#define TLOSS 5
-#define PLOSS 6
-
-extern "C" int matherr(libm_exception*);
-
-#endif
-
-#include <float.h>
-
-/* On some systems, HUGE ought to be MAXFLOAT or IEEE infinity */
-
-#ifndef HUGE
-#define HUGE DBL_MAX
-#endif
-#ifndef HUGE_VAL
-#define HUGE_VAL DBL_MAX
-#endif
-
-
-/* sequents don't supply these. The following should suffice */
-#if defined(sequent) || defined(DGUX) || defined(sony) || defined(masscomp) \
-|| defined(hpux)
-#include <float.h>
-static inline int isnan(double x) { return x != x; }
-static inline int isinf(double x) { return x > DBL_MAX || x < -DBL_MAX; }
-#endif
-
-/* These seem to be sun & sysV names of these constants */
-
-#ifndef M_E
-#define M_E 2.7182818284590452354
-#endif
-#ifndef M_LOG2E
-#define M_LOG2E 1.4426950408889634074
-#endif
-#ifndef M_LOG10E
-#define M_LOG10E 0.43429448190325182765
-#endif
-#ifndef M_LN2
-#define M_LN2 0.69314718055994530942
-#endif
-#ifndef M_LN10
-#define M_LN10 2.30258509299404568402
-#endif
-#ifndef M_PI
-#define M_PI 3.14159265358979323846
-#endif
-#ifndef M_PI_2
-#define M_PI_2 1.57079632679489661923
-#endif
-#ifndef M_1_PI
-#define M_1_PI 0.31830988618379067154
-#endif
-#ifndef M_PI_4
-#define M_PI_4 0.78539816339744830962
-#endif
-#ifndef M_2_PI
-#define M_2_PI 0.63661977236758134308
-#endif
-#ifndef M_2_SQRTPI
-#define M_2_SQRTPI 1.12837916709551257390
-#endif
-#ifndef M_SQRT2
-#define M_SQRT2 1.41421356237309504880
-#endif
-#ifndef M_SQRT1_2
-#define M_SQRT1_2 0.70710678118654752440
-#endif
-
-#ifndef PI // as in stroustrup
-#define PI M_PI
-#endif
-#ifndef PI2
-#define PI2 M_PI_2
-#endif
-
-#endif
diff --git a/gnu/lib/libg++/g++-include/max.h b/gnu/lib/libg++/g++-include/max.h
deleted file mode 100644
index 8c2c8f98ced..00000000000
--- a/gnu/lib/libg++/g++-include/max.h
+++ /dev/null
@@ -1 +0,0 @@
-#include <builtin.h>
diff --git a/gnu/lib/libg++/g++-include/memory.h b/gnu/lib/libg++/g++-include/memory.h
deleted file mode 100644
index b54cecb9f47..00000000000
--- a/gnu/lib/libg++/g++-include/memory.h
+++ /dev/null
@@ -1,43 +0,0 @@
-// $Id: memory.h,v 1.3 1993/08/14 22:07:31 mycroft Exp $
-
-#ifndef _memory_h
-#define _memory_h 1
-
-#include "_G_config.h"
-#include <stddef.h>
-
-extern "C" {
-
-void* memalign _G_ARGS((_G_size_t, _G_size_t));
-void* memccpy _G_ARGS((void*, const void*, int, _G_size_t));
-void* memchr _G_ARGS((const void*, int, _G_size_t));
-int memcmp _G_ARGS((const void*, const void*, _G_size_t));
-void* memcpy _G_ARGS((void*, const void*, _G_size_t));
-void* memmove _G_ARGS((void*, const void*, _G_size_t));
-void* memset _G_ARGS((void*, int, _G_size_t));
-int ffs _G_ARGS((int));
-#if defined(__OSF1__) || defined(__NetBSD__)
-int getpagesize _G_ARGS((void));
-#else
-_G_size_t getpagesize _G_ARGS((void));
-#endif
-void* valloc _G_ARGS((_G_size_t));
-
-void bcopy _G_ARGS((const void*, void*, _G_size_t));
-int bcmp _G_ARGS((const void*, const void*, int));
-void bzero _G_ARGS((void*, int));
-}
-
-#ifdef __GNUG__
-#ifndef alloca
-#define alloca(x) __builtin_alloca(x)
-#endif
-#else
-#ifndef IV
-extern "C" void* alloca(_G_size_t);
-#else
-extern "C" void* alloca(unsigned long);
-#endif /* IV */
-#endif
-
-#endif
diff --git a/gnu/lib/libg++/g++-include/min.h b/gnu/lib/libg++/g++-include/min.h
deleted file mode 100644
index 8c2c8f98ced..00000000000
--- a/gnu/lib/libg++/g++-include/min.h
+++ /dev/null
@@ -1 +0,0 @@
-#include <builtin.h>
diff --git a/gnu/lib/libg++/g++-include/minmax.h b/gnu/lib/libg++/g++-include/minmax.h
deleted file mode 100644
index 8c2c8f98ced..00000000000
--- a/gnu/lib/libg++/g++-include/minmax.h
+++ /dev/null
@@ -1 +0,0 @@
-#include <builtin.h>
diff --git a/gnu/lib/libg++/g++-include/netdb.h b/gnu/lib/libg++/g++-include/netdb.h
deleted file mode 100644
index 4c47550ba2d..00000000000
--- a/gnu/lib/libg++/g++-include/netdb.h
+++ /dev/null
@@ -1,6 +0,0 @@
-// $Id: netdb.h,v 1.2 1993/08/02 17:22:11 mycroft Exp $
-
-extern "C"
-{
-#include_next <netdb.h>
-}
diff --git a/gnu/lib/libg++/g++-include/new.h b/gnu/lib/libg++/g++-include/new.h
deleted file mode 100644
index 95d86e02183..00000000000
--- a/gnu/lib/libg++/g++-include/new.h
+++ /dev/null
@@ -1,33 +0,0 @@
-#ifndef _new_h
-#ifdef __GNUG__
-#pragma once
-#pragma interface
-#endif
-#define _new_h 1
-
-#include <stddef.h>
-#include <std.h>
-
-#ifndef NO_LIBGXX_MALLOC
-#define MALLOC_ALIGN_MASK 7 /* ptrs aligned at 8 byte boundaries */
-#define MALLOC_MIN_OVERHEAD 8 /* 8 bytes of overhead per pointer */
-#endif
-
-typedef void (*new_handler_t)();
-extern "C" void default_new_handler();
-extern "C" new_handler_t set_new_handler(new_handler_t);
-
-#ifdef __GNUG__
-#define NEW(where) new { where }
-#endif
-
-// default placement version of operator new
-static inline void *operator new(size_t, void *place) { return place; }
-
-// provide a C++ interface to vector-resize via realloc
-static inline void *operator new(size_t size, void *ptr, size_t new_len)
-{
- return realloc(ptr, new_len * size);
-}
-
-#endif
diff --git a/gnu/lib/libg++/g++-include/open.h b/gnu/lib/libg++/g++-include/open.h
deleted file mode 100644
index ffe81a15ac1..00000000000
--- a/gnu/lib/libg++/g++-include/open.h
+++ /dev/null
@@ -1,39 +0,0 @@
-
-#ifndef _open_h
-#ifdef __GNUG__
-#pragma once
-#pragma interface
-#endif
-#define _open_h 1
-
-#include <File.h>
-#include <sys/file.h> // needed to determine values of O_RDONLY...
-
-/*
-
- translation stuff for opening files.
-
-*/
-
-
-enum sys_open_cmd_io_mode // These should be correct for most systems
-{
- sio_read = O_RDONLY,
- sio_write = O_WRONLY,
- sio_readwrite = O_RDWR,
- sio_append = O_APPEND
-};
-
-enum sys_open_cmd_access_mode
-{
- sa_create = O_CREAT,
- sa_truncate = O_TRUNC,
- sa_createonly = O_EXCL | O_CREAT
-};
-
-
-int open_cmd_arg(io_mode i, access_mode a); // decode modes
-char* fopen_cmd_arg(io_mode i);
-int open_cmd_arg(const char* m);
-
-#endif
diff --git a/gnu/lib/libg++/g++-include/osfcn.h b/gnu/lib/libg++/g++-include/osfcn.h
deleted file mode 100644
index 52b3063586f..00000000000
--- a/gnu/lib/libg++/g++-include/osfcn.h
+++ /dev/null
@@ -1,4 +0,0 @@
-#include <errno.h>
-#include <stdlib.h>
-#include <string.h>
-#include <unistd.h>
diff --git a/gnu/lib/libg++/g++-include/ostream.h b/gnu/lib/libg++/g++-include/ostream.h
deleted file mode 100644
index 3bf30d735d6..00000000000
--- a/gnu/lib/libg++/g++-include/ostream.h
+++ /dev/null
@@ -1,256 +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 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.
-*/
-
-/* *** Version 1.2 -- nearly 100% AT&T 1.2 compatible *** */
-
-/* ostream.h now separately includable */
-
-#ifndef _ostream_h
-#ifdef __GNUG__
-#pragma once
-#pragma interface
-#endif
-#define _ostream_h 1
-
-/* uncomment the next line to disable ostream << char */
-//#define NO_OUTPUT_CHAR
-
-
-#include <File.h>
-#include <streambuf.h>
-#include <filebuf.h>
-#include <Filebuf.h>
-
-class istream;
-
-class ostream
-{
- friend class istream;
-protected:
- streambuf* bp;
- state_value state; // _good/_eof/_fail/_bad
- char ownbuf; // true if we own *bp
-
-public:
- ostream(const char* filename, io_mode m, access_mode a);
- ostream(const char* filename, const char* m);
- ostream(int filedesc, io_mode m);
- ostream(FILE* fileptr);
- ostream(int sz, char* buf);
- ostream(int filedesc, char* buf, int buflen);
- ostream(int filedesc);
- ostream(streambuf* s);
-
- ~ostream();
-
- ostream& open(const char* filename, io_mode m, access_mode a);
- ostream& open(const char* filename, const char* m);
- ostream& open(int filedesc, io_mode m);
- ostream& open(FILE* fileptr);
- ostream& open(const char* filenam, open_mode m);
-
- ostream& close();
- ostream& flush();
-
-// stream status
-
- int rdstate();
- int eof();
- int fail();
- int bad();
- int good();
-
-// other status queries
-
- int readable();
- int writable();
- int is_open();
-
- operator void*();
- int operator !();
-
- const char* name();
-
- char* bufptr();
-
-// error handling
-
- void error();
- void clear(state_value f = _good); // poorly named
- void set(state_value f); // set corresponding bit
- void unset(state_value); // clear corresponding bit
- ostream& failif(int cond);
-
-// unformatted IO
-
- ostream& put(char c);
- ostream& put(const char* s);
- ostream& put(const char* s, int slen);
-
-// formatted IO
-
- ostream& form(const char* fmt, ...);
-
- ostream& operator << (short n);
- ostream& operator << (unsigned short n);
- ostream& operator << (int n);
- ostream& operator << (unsigned int n);
- ostream& operator << (long n);
- ostream& operator << (unsigned long n);
-#ifdef __GNUG__
- ostream& operator << (long long n);
- ostream& operator << (unsigned long long n);
-#endif __GNUG__
- ostream& operator << (float n);
- ostream& operator << (double n);
- ostream& operator << (const char* s);
- ostream& operator << (const void* ptr);
-
-#ifndef NO_OUTPUT_CHAR
- ostream& operator << (char c);
-#endif
-
-};
-
-extern ostream cout; // stdout
-extern ostream cerr; // stderr
-
-#if defined(__OPTIMIZE__) || defined(USE_LIBGXX_INLINES)
-
-
-inline void ostream::clear(state_value flag)
-{
- state = flag;
-}
-
-inline void ostream::set(state_value flag)
-{
- state = state_value(int(state) | int(flag));
-}
-
-inline void ostream::unset(state_value flag)
-{
- state = state_value(int(state) & ~int(flag));
-}
-
-inline int ostream::rdstate()
-{
- return int(state);
-}
-
-inline int ostream::good()
-{
- return state == _good;
-}
-
-inline int ostream::eof()
-{
- return int(state) & int(_eof);
-}
-
-inline int ostream::fail()
-{
- return int(state) & int(_fail);
-}
-
-inline int ostream::bad()
-{
- return int(state) & int(_bad);
-}
-
-inline ostream::operator void*()
-{
- return (state == _good)? this : 0;
-}
-
-inline int ostream::operator !()
-{
- return (state != _good);
-}
-
-inline ostream& ostream::failif(int cond)
-{
- if (cond) set(_fail); return *this;
-}
-
-inline int ostream::is_open()
-{
- return bp->is_open();
-}
-
-inline int ostream::readable()
-{
- return 0;
-}
-
-inline int ostream::writable()
-{
- return (bp != 0) && (state == _good);
-}
-
-
-inline char* ostream::bufptr()
-{
- return bp->base;
-}
-
-inline ostream& ostream::flush()
-{
- bp->overflow(); return *this;
-}
-
-inline ostream& ostream::close()
-{
- bp->overflow(); bp->close(); return *this;
-}
-
-inline ostream& ostream::put(char ch)
-{
- return failif((state != _good) || bp->sputc((int)ch &0xff) == EOF);
-}
-
-#ifndef NO_OUTPUT_CHAR
-inline ostream& ostream::operator << (char ch)
-{
- return failif((state != _good) || bp->sputc((int)ch &0xff) == EOF);
-}
-#endif
-
-inline ostream& ostream::put(const char* s)
-{
- return failif((state != _good) || bp->sputs(s) == EOF);
-}
-
-inline ostream& ostream::put(const char* s, int len)
-{
- return failif((state != _good) || bp->sputsn(s, len) == EOF);
-}
-
-inline ostream& ostream::operator << (const char* s)
-{
- return failif((state != _good) || bp->sputs(s) == EOF);
-}
-
-#endif
-
-#endif
diff --git a/gnu/lib/libg++/g++-include/pwd.h b/gnu/lib/libg++/g++-include/pwd.h
deleted file mode 100644
index f39267f2bf1..00000000000
--- a/gnu/lib/libg++/g++-include/pwd.h
+++ /dev/null
@@ -1,38 +0,0 @@
-// $Id: pwd.h,v 1.2 1993/08/02 17:22:12 mycroft Exp $
-
-#ifndef _pwd_h
-
-// the Interviews-based standard kludge again
-
-extern "C" {
-
-#ifdef __pwd_h_recursive
-#include_next <pwd.h>
-#else
-#define getpwent c_proto_getpwent
-#define getpwuid c_proto_getpwuid
-#define getpwnam c_proto_getpwnam
-#define setpwent c_proto_setpwent
-#define endpwent c_proto_endpwent
-
-#define __pwd_h_recursive
-#include_next <pwd.h>
-
-#define _pwd_h 1
-
-#undef getpwent
-#undef getpwuid
-#undef getpwnam
-#undef setpwent
-#undef endpwent
-
-extern struct passwd* getpwent();
-extern struct passwd* getpwuid(int);
-extern struct passwd* getpwnam(const char*);
-extern int setpwent();
-extern int endpwent();
-
-#endif
-}
-
-#endif
diff --git a/gnu/lib/libg++/g++-include/regex.h b/gnu/lib/libg++/g++-include/regex.h
deleted file mode 100644
index e0252cb72d3..00000000000
--- a/gnu/lib/libg++/g++-include/regex.h
+++ /dev/null
@@ -1,280 +0,0 @@
-/* Definitions for data structures callers pass the regex library.
- Copyright (C) 1985 Free Software Foundation, Inc.
-
- NO WARRANTY
-
- BECAUSE THIS PROGRAM IS LICENSED FREE OF CHARGE, WE PROVIDE ABSOLUTELY
-NO WARRANTY, TO THE EXTENT PERMITTED BY APPLICABLE STATE LAW. EXCEPT
-WHEN OTHERWISE STATED IN WRITING, FREE SOFTWARE FOUNDATION, INC,
-RICHARD M. STALLMAN AND/OR OTHER PARTIES PROVIDE THIS 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.
-
- IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW WILL RICHARD M.
-STALLMAN, THE FREE SOFTWARE FOUNDATION, INC., AND/OR ANY OTHER PARTY
-WHO MAY MODIFY AND REDISTRIBUTE THIS PROGRAM AS PERMITTED BELOW, BE
-LIABLE TO YOU FOR DAMAGES, INCLUDING ANY LOST PROFITS, LOST MONIES, OR
-OTHER SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
-USE OR INABILITY TO USE (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR
-DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY THIRD PARTIES OR
-A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS) THIS
-PROGRAM, EVEN IF YOU HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH
-DAMAGES, OR FOR ANY CLAIM BY ANY OTHER PARTY.
-
- GENERAL PUBLIC LICENSE TO COPY
-
- 1. You may copy and distribute verbatim copies of this source file
-as you receive it, in any medium, provided that you conspicuously and
-appropriately publish on each copy a valid copyright notice "Copyright
-(C) 1985 Free Software Foundation, Inc."; and include following the
-copyright notice a verbatim copy of the above disclaimer of warranty
-and of this License. You may charge a distribution fee for the
-physical act of transferring a copy.
-
- 2. You may modify your copy or copies of this source file or
-any portion of it, and copy and distribute such modifications under
-the terms of Paragraph 1 above, provided that you also do the following:
-
- a) cause the modified files to carry prominent notices stating
- that you changed the files and the date of any change; and
-
- b) cause the whole of any work that you distribute or publish,
- that in whole or in part contains or is a derivative of this
- program or any part thereof, to be licensed at no charge to all
- third parties on terms identical to those contained in this
- License Agreement (except that you may choose to grant more extensive
- warranty protection to some or all third parties, at your option).
-
- c) You may charge a distribution fee for the physical act of
- transferring a copy, and you may at your option offer warranty
- protection in exchange for a fee.
-
-Mere aggregation of another unrelated program with this program (or its
-derivative) on a volume of a storage or distribution medium does not bring
-the other program under the scope of these terms.
-
- 3. You may copy and distribute this program (or a portion or derivative
-of it, under Paragraph 2) in object code or executable form under the terms
-of Paragraphs 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
- Paragraphs 1 and 2 above; or,
-
- b) accompany it with a written offer, valid for at least three
- years, to give any third party free (except for a nominal
- shipping charge) a complete machine-readable copy of the
- corresponding source code, to be distributed under the terms of
- Paragraphs 1 and 2 above; or,
-
- c) accompany it with the information you received as to where the
- corresponding source code may be obtained. (This alternative is
- allowed only for noncommercial distribution and only if you
- received the program in object code or executable form alone.)
-
-For an executable file, complete source code means all the source code for
-all modules it contains; but, as a special exception, it need not include
-source code for modules which are standard libraries that accompany the
-operating system on which the executable file runs.
-
- 4. You may not copy, sublicense, distribute or transfer this program
-except as expressly provided under this License Agreement. Any attempt
-otherwise to copy, sublicense, distribute or transfer this program is void and
-your rights to use the program under this License agreement shall be
-automatically terminated. However, parties who have received computer
-software programs from you with this License Agreement will not have
-their licenses terminated so long as such parties remain in full compliance.
-
- 5. If you wish to incorporate parts of this program into other free
-programs whose distribution conditions are different, write to the Free
-Software Foundation at 675 Mass Ave, Cambridge, MA 02139. We have not yet
-worked out a simple rule that can be stated here, but we will often permit
-this. We 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.
-
-
-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! */
-
-#if defined(SHORT_NAMES) || defined(VMS)
-#define re_compile_pattern recmppat
-#define re_pattern_buffer repatbuf
-#define re_registers reregs
-#endif
-
-/* Define number of parens for which we record the beginnings and ends.
- This affects how much space the `struct re_registers' type takes up. */
-#ifndef RE_NREGS
-#define RE_NREGS 10
-#endif
-
-/* These bits are used in the obscure_syntax variable to choose among
- alternative regexp syntaxes. */
-
-/* 1 means plain parentheses serve as grouping, and backslash
- parentheses are needed for literal searching.
- 0 means backslash-parentheses are grouping, and plain parentheses
- are for literal searching. */
-#define RE_NO_BK_PARENS 1
-
-/* 1 means plain | serves as the "or"-operator, and \| is a literal.
- 0 means \| serves as the "or"-operator, and | is a literal. */
-#define RE_NO_BK_VBAR 2
-
-/* 0 means plain + or ? serves as an operator, and \+, \? are literals.
- 1 means \+, \? are operators and plain +, ? are literals. */
-#define RE_BK_PLUS_QM 4
-
-/* 1 means | binds tighter than ^ or $.
- 0 means the contrary. */
-#define RE_TIGHT_VBAR 8
-
-/* 1 means treat \n as an _OR operator
- 0 means treat it as a normal character */
-#define RE_NEWLINE_OR 16
-
-/* 0 means that a special characters (such as *, ^, and $) always have
- their special meaning regardless of the surrounding context.
- 1 means that special characters may act as normal characters in some
- contexts. Specifically, this applies to:
- ^ - only special at the beginning, or after ( or |
- $ - only special at the end, or before ) or |
- *, +, ? - only special when not after the beginning, (, or | */
-#define RE_CONTEXT_INDEP_OPS 32
-
-/* Now define combinations of bits for the standard possibilities. */
-#define RE_SYNTAX_AWK (RE_NO_BK_PARENS | RE_NO_BK_VBAR | RE_CONTEXT_INDEP_OPS)
-#define RE_SYNTAX_EGREP (RE_SYNTAX_AWK | RE_NEWLINE_OR)
-#define RE_SYNTAX_GREP (RE_BK_PLUS_QM | RE_NEWLINE_OR)
-#define RE_SYNTAX_EMACS 0
-
-/* This data structure is used to represent a compiled pattern. */
-
-struct re_pattern_buffer
- {
- char *buffer; /* Space holding the compiled pattern commands. */
- int allocated; /* Size of space that buffer points to */
- int used; /* Length of portion of buffer actually occupied */
- char *fastmap; /* Pointer to fastmap, if any, or zero if none. */
- /* re_search uses the fastmap, if there is one,
- to skip quickly over totally implausible characters */
- char *translate; /* Translate table to apply to all characters before comparing.
- Or zero for no translation.
- The translation is applied to a pattern when it is compiled
- and to data when it is matched. */
- char fastmap_accurate;
- /* Set to zero when a new pattern is stored,
- set to one when the fastmap is updated from it. */
- char can_be_null; /* Set to one by compiling fastmap
- if this pattern might match the null string.
- It does not necessarily match the null string
- in that case, but if this is zero, it cannot.
- 2 as value means can match null string
- but at end of range or before a character
- listed in the fastmap. */
- };
-
-/* Structure to store "register" contents data in.
-
- Pass the address of such a structure as an argument to re_match, etc.,
- if you want this information back.
-
- start[i] and end[i] record the string matched by \( ... \) grouping i,
- for i from 1 to RE_NREGS - 1.
- start[0] and end[0] record the entire string matched. */
-
-struct re_registers
- {
- int start[RE_NREGS];
- int end[RE_NREGS];
- };
-
-/* These are the command codes that appear in compiled regular expressions, one per byte.
- Some command codes are followed by argument bytes.
- A command code can specify any interpretation whatever for its arguments.
- Zero-bytes may appear in the compiled regular expression. */
-
-enum regexpcode
- {
- unused,
- exactn, /* followed by one byte giving n, and then by n literal bytes */
- begline, /* fails unless at beginning of line */
- endline, /* fails unless at end of line */
- jump, /* followed by two bytes giving relative address to jump to */
- on_failure_jump, /* followed by two bytes giving relative address of place
- to resume at in case of failure. */
- finalize_jump, /* Throw away latest failure point and then jump to address. */
- maybe_finalize_jump, /* Like jump but finalize if safe to do so.
- This is used to jump back to the beginning
- of a repeat. If the command that follows
- this jump is clearly incompatible with the
- one at the beginning of the repeat, such that
- we can be sure that there is no use backtracking
- out of repetitions already completed,
- then we finalize. */
- dummy_failure_jump, /* jump, and push a dummy failure point.
- This failure point will be thrown away
- if an attempt is made to use it for a failure.
- A + construct makes this before the first repeat. */
- anychar, /* matches any one character */
- charset, /* matches any one char belonging to specified set.
- First following byte is # bitmap bytes.
- Then come bytes for a bit-map saying which chars are in.
- Bits in each byte are ordered low-bit-first.
- A character is in the set if its bit is 1.
- A character too large to have a bit in the map
- is automatically not in the set */
- charset_not, /* similar but match any character that is NOT one of those specified */
- start_memory, /* starts remembering the text that is matched
- and stores it in a memory register.
- followed by one byte containing the register number.
- Register numbers must be in the range 0 through NREGS. */
- stop_memory, /* stops remembering the text that is matched
- and stores it in a memory register.
- followed by one byte containing the register number.
- Register numbers must be in the range 0 through NREGS. */
- duplicate, /* match a duplicate of something remembered.
- Followed by one byte containing the index of the memory register. */
- before_dot, /* Succeeds if before dot */
- at_dot, /* Succeeds if at dot */
- after_dot, /* Succeeds if after dot */
- begbuf, /* Succeeds if at beginning of buffer */
- endbuf, /* Succeeds if at end of buffer */
- wordchar, /* Matches any word-constituent character */
- notwordchar, /* Matches any char that is not a word-constituent */
- wordbeg, /* Succeeds if at word beginning */
- wordend, /* Succeeds if at word end */
- wordbound, /* Succeeds if at a word boundary */
- notwordbound, /* Succeeds if not at a word boundary */
- syntaxspec, /* Matches any character whose syntax is specified.
- followed by a byte which contains a syntax code, Sword or such like */
- notsyntaxspec /* Matches any character whose syntax differs from the specified. */
- };
-
-
-extern char *re_compile_pattern (char*, int, struct re_pattern_buffer*);
-/* Is this really advertised? */
-extern void re_compile_fastmap (struct re_pattern_buffer*);
-extern int re_search(struct re_pattern_buffer*, char*, int, int,
- int, struct re_registers*);
-extern int re_search_2 (struct re_pattern_buffer*, char*, int,
- char*, int, int, int, struct re_registers*, int);
-extern int re_match (struct re_pattern_buffer*, char*, int, int,
- struct re_registers*);
-extern int re_match_2 (struct re_pattern_buffer*, unsigned char*, int,
- unsigned char*, int, int, struct re_registers*, int);
-
-/* 4.2 bsd compatibility (yuck) */
-extern char *re_comp (char*);
-extern int re_exec (char*);
-
-#ifdef SYNTAX_TABLE
-extern char *re_syntax_table;
-#endif
-
diff --git a/gnu/lib/libg++/g++-include/setjmp.h b/gnu/lib/libg++/g++-include/setjmp.h
deleted file mode 100644
index 12bb1daac61..00000000000
--- a/gnu/lib/libg++/g++-include/setjmp.h
+++ /dev/null
@@ -1,31 +0,0 @@
-// $Id: setjmp.h,v 1.2 1993/08/02 17:22:13 mycroft Exp $
-
-#ifndef _setjmp_h
-
-extern "C" {
-
-#ifdef __setjmp_h_recursive
-#include_next <setjmp.h>
-#else
-#define __setjmp_h_recursive
-#define setjmp C_header_setjmp
-#define longjmp C_header_longjmp
-
-#ifdef VMS
-#include "gnu_cc_include:[000000]setjmp.h"
-#else
-#include_next <setjmp.h>
-#endif
-
-#undef setjmp
-#undef longjmp
-
-#define _setjmp_h 1
-
-extern int setjmp(jmp_buf);
-extern void longjmp(jmp_buf, int);
-
-#endif
-}
-
-#endif
diff --git a/gnu/lib/libg++/g++-include/signal.h b/gnu/lib/libg++/g++-include/signal.h
deleted file mode 100644
index 6ba7b5a0171..00000000000
--- a/gnu/lib/libg++/g++-include/signal.h
+++ /dev/null
@@ -1,82 +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, 675 Mass Ave, Cambridge, MA 02139, USA.
-
- $Id: signal.h,v 1.3 1993/08/14 22:07:32 mycroft Exp $
-*/
-
-#ifndef _signal_h
-
-#include <_G_config.h>
-
-extern "C" {
-
-#ifdef __signal_h_recursive
-#include_next <signal.h>
-#else
-
-#define __signal_h_recursive
-
-#define signal __hide_signal
-#define psignal __hide_psignal
-#include_next <signal.h>
-#undef signal
-#undef psignal
-
-#define _signal_h 1
-
-// The Interviews folks call this SignalHandler. Might as well conform.
-typedef _G_signal_return_type (*SignalHandler) (...);
-typedef int (*SSignalHandler) (...);
-
-extern SignalHandler signal _G_ARGS((int sig, SignalHandler action));
-//extern SignalHandler sigset _G_ARGS((int sig, SignalHandler action));
-extern SSignalHandler ssignal _G_ARGS((int sig, SSignalHandler action));
-extern int gsignal _G_ARGS((int sig));
-extern int kill _G_ARGS((_G_pid_t pid, int sig));
-#ifndef __NetBSD__
-extern int killpg _G_ARGS((short int, int));
-#else
-extern int killpg _G_ARGS((_G_pid_t, int));
-#endif
-extern int siginterrupt _G_ARGS((int, int));
-extern void psignal _G_ARGS((unsigned, const char*));
-
-#ifndef hpux // Interviews folks claim that hpux doesn't like these
-extern int sigsetmask _G_ARGS((int mask));
-extern int sigblock _G_ARGS((int mask));
-extern int sigpause _G_ARGS((int mask));
-extern int sigvec _G_ARGS((int, struct sigvec*, struct sigvec*));
-#endif
-
-// The Interviews version also has these ...
-
-#define SignalBad ((SignalHandler)-1)
-#define SignalDefault ((SignalHandler)0)
-#define SignalIgnore ((SignalHandler)1)
-
-#undef BADSIG
-#undef SIG_DFL
-#undef SIG_IGN
-#define BAD_SIG SignalBad
-#define SIG_DFL SignalDefault
-#define SIG_IGN SignalIgnore
-
-#endif
-}
-
-#endif
-
diff --git a/gnu/lib/libg++/g++-include/std.h b/gnu/lib/libg++/g++-include/std.h
deleted file mode 100644
index 52b3063586f..00000000000
--- a/gnu/lib/libg++/g++-include/std.h
+++ /dev/null
@@ -1,4 +0,0 @@
-#include <errno.h>
-#include <stdlib.h>
-#include <string.h>
-#include <unistd.h>
diff --git a/gnu/lib/libg++/g++-include/stdarg.h b/gnu/lib/libg++/g++-include/stdarg.h
deleted file mode 100644
index 98c42e9f520..00000000000
--- a/gnu/lib/libg++/g++-include/stdarg.h
+++ /dev/null
@@ -1,5 +0,0 @@
-// $Id: stdarg.h,v 1.2 1993/08/02 17:22:15 mycroft Exp $
-
-extern "C" {
-#include_next <stdarg.h>
-}
diff --git a/gnu/lib/libg++/g++-include/stddef.h b/gnu/lib/libg++/g++-include/stddef.h
deleted file mode 100644
index 9a4dc6b357c..00000000000
--- a/gnu/lib/libg++/g++-include/stddef.h
+++ /dev/null
@@ -1,14 +0,0 @@
-// $Id: stddef.h,v 1.2 1993/08/02 17:22:16 mycroft Exp $
-
-#ifndef __libgxx_stddef_h
-
-extern "C" {
-#ifdef __stddef_h_recursive
-#include_next <stddef.h>
-#else
-#include_next <stddef.h>
-
-#define __libgxx_stddef_h 1
-#endif
-}
-#endif
diff --git a/gnu/lib/libg++/g++-include/stdio.h b/gnu/lib/libg++/g++-include/stdio.h
deleted file mode 100644
index 05bb2e2e29e..00000000000
--- a/gnu/lib/libg++/g++-include/stdio.h
+++ /dev/null
@@ -1,182 +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, 675 Mass Ave, Cambridge, MA 02139, USA.
-
- $Id: stdio.h,v 1.3 1993/08/14 22:07:32 mycroft Exp $
-*/
-
-#ifndef _stdio_h
-#ifdef __GNUG__
-#pragma interface
-#endif
-
-#ifdef __stdio_h_recursive
-#include_next <stdio.h>
-#else
-#define __stdio_h_recursive
-
-// Note: The #define _stdio_h is at the end of this file,
-// in case #include_next <stdio.h> finds an installed version of this
-// same file -- we want it to continue until it finds the C version.
-
-#include <_G_config.h>
-
-extern "C" {
-
-#undef NULL
-
-#define fdopen __hide_fdopen
-#define fopen __hide_fopen
-#define fprintf __hide_fprintf
-#define fputs __hide_fputs
-#define fread __hide_fread
-#define freopen __hide_freopen
-#define fscanf __hide_fscanf
-#define ftell __hide_ftell
-#define fwrite __hide_fwrite
-#define new __hide_new /* In case 'new' is used as a parameter name. */
-#define perror __hide_perror
-#define popen __hide_popen
-#define printf __hide_printf
-#define puts __hide_puts
-#define putw __hide_putw
-#define rewind __hide_rewind
-#define tempnam __hide_tempnam
-#define scanf __hide_scanf
-#define setbuf __hide_setbuf
-#define setbuffer __hide_setbuffer
-#define setlinebuf __hide_setlinebuf
-#define setvbuf __hide_setvbuf
-#define sprintf __hide_sprintf
-#define sscanf __hide_sscanf
-#define tempnam __hide_tempnam
-#define vfprintf __hide_vfprintf
-#define vprintf __hide_vprintf
-#define vsprintf __hide_vsprintf
-#define _flsbuf __hide__flsbuf
-
-#include_next <stdio.h>
-
-#undef fdopen
-#undef fopen
-#undef fprintf
-#undef fputs
-#undef fread
-#undef freopen
-#undef fscanf
-#undef ftell
-#undef fwrite
-#undef new
-#undef perror
-#undef popen
-#undef printf
-#undef puts
-#undef putw
-/* SCO defines remove to call unlink; that's very dangerous for us. */
-#undef remove
-#undef rewind
-#undef tempnam
-#undef scanf
-#undef setbuf
-#undef setbuffer
-#undef setlinebuf
-#undef setvbuf
-#undef sprintf
-#undef sscanf
-#undef tempnam
-#undef vprintf
-#undef vfprintf
-#undef vsprintf
-#undef _flsbuf
-
-#ifndef NULL
-#define NULL _G_NULL
-#endif
-
-#ifndef size_t
-#define size_t _G_size_t
-#endif
-}
-
-extern "C" {
-
-int fclose(FILE*);
-FILE* fdopen(int, const char*);
-int fflush(FILE*);
-int fgetc(FILE*);
-#ifndef __NetBSD__
-char* fgets _G_ARGS((char*, int, FILE *));
-#else
-char* fgets _G_ARGS((char*, _G_size_t, FILE *));
-#endif
-FILE* fopen(const char*, const char*);
-int fprintf(FILE*, const char* ...);
-int fputc(int, FILE*);
-int fputs(const char*, FILE*);
-size_t fread(void*, size_t, size_t, FILE*);
-#ifdef VMS
-FILE* freopen(const char*, const char*, FILE* ...);
-#else
-FILE* freopen(const char*, const char*, FILE*);
-#endif
-int fscanf(FILE*, const char* ...);
-int fseek(FILE*, long, int);
-long ftell(FILE *);
-size_t fwrite(const void*, size_t, size_t, FILE*);
-char* gets(char*);
-int getw(FILE*);
-int pclose(FILE*);
-void perror(const char*);
-FILE* popen(const char*, const char*);
-int printf(const char* ...);
-int puts(const char*);
-int putw(int, FILE*);
-int rewind(FILE*);
-int scanf(const char* ...);
-void setbuf(FILE*, char*);
-void setbuffer(FILE*, char*, int);
-int setlinebuf(FILE*);
-int setvbuf(FILE*, char*, int, size_t);
-int sscanf(char*, const char* ...);
-FILE* tmpfile();
-int ungetc(int, FILE*);
-int vfprintf _G_ARGS((FILE*, const char*, _G_va_list));
-int vprintf _G_ARGS((const char*, _G_va_list));
-_G_sprintf_return_type sprintf _G_ARGS((char*, const char* ...));
-_G_sprintf_return_type vsprintf _G_ARGS((char*, const char*, _G_va_list));
-
-extern int _filbuf _G_ARGS((FILE*));
-extern int _flsbuf _G_ARGS((unsigned, FILE*));
-
-}
-
-#ifndef L_ctermid
-#define L_ctermid 9
-#endif
-#ifndef L_cuserid
-#define L_cuserid 9
-#endif
-#ifndef P_tmpdir
-#define P_tmpdir "/tmp/"
-#endif
-#ifndef L_tmpnam
-#define L_tmpnam (sizeof(P_tmpdir) + 15)
-#endif
-
-#define _stdio_h 1
-
-#endif
-#endif // _stdio_h
diff --git a/gnu/lib/libg++/g++-include/stdlib.h b/gnu/lib/libg++/g++-include/stdlib.h
deleted file mode 100644
index 3b7e14efcb0..00000000000
--- a/gnu/lib/libg++/g++-include/stdlib.h
+++ /dev/null
@@ -1,81 +0,0 @@
-// $Id: stdlib.h,v 1.2 1993/08/02 17:22:17 mycroft Exp $
-
-#ifndef _stdlib_h
-#define _stdlib_h 1
-
-#include <_G_config.h>
-#include <stddef.h>
-
-extern "C" {
-
-int abs(int);
-
-#ifdef __GNUG__
-void volatile abort(void);
-#else
-void abort(void);
-#endif
-
-double atof(const char*);
-int atoi(const char*);
-long atol(const char*);
-
-int atexit(auto void (*p) (void));
-void* bsearch (const void *, const void *, size_t,
- size_t, auto int (*ptf)(const void*, const void*));
-void* calloc(size_t, size_t);
-void cfree(void*);
-
-#ifdef __GNUG__
-void volatile exit(int);
-#else
-void exit(int);
-#endif
-
-char* fcvt(double, int, int*, int*);
-void free(void*);
-char* getenv(const char*);
-int getopt _G_ARGS((int, char * const *, const char*));
-int getpw(int, char*);
-char* gcvt(double, int, char*);
-char* ecvt(double, int, int*, int*);
-extern char** environ;
-
-long labs(long);
-void* malloc(size_t);
-size_t malloc_usable_size(void*);
-int putenv(const char*);
-extern char* optarg;
-extern int opterr;
-extern int optind;
-void qsort(void*, size_t, size_t, auto int (*ptf)(void*,void*));
-int rand(void);
-void* realloc(void*, size_t);
-int setkey(const char*);
-int srand(unsigned int);
-double strtod(const char*, char**);
-long strtol(const char*, char**, int);
-unsigned long strtoul(const char*, char **, int);
-int system(const char*);
-
-long random(void);
-void srandom(int);
-char* setstate(char*);
-char* initstate(unsigned, char*, int);
-
-double drand48(void);
-void lcong48(short*);
-long jrand48(short*);
-long lrand48(void);
-long mrand48(void);
-long nrand48(short*);
-short* seed48(short*);
-void srand48(long);
-
-char* ctermid(char*);
-char* cuserid(char*);
-char* tempnam(const char*, const char*);
-char* tmpnam(char*);
-
-}
-#endif
diff --git a/gnu/lib/libg++/g++-include/strclass.h b/gnu/lib/libg++/g++-include/strclass.h
deleted file mode 100644
index e1799f1ac4e..00000000000
--- a/gnu/lib/libg++/g++-include/strclass.h
+++ /dev/null
@@ -1,8 +0,0 @@
-#ifndef _strclass_h
-#ifdef __GNUG__
-#pragma once
-#endif
-#define _strclass_h
-#include <String.h>
-typedef class String string;
-#endif
diff --git a/gnu/lib/libg++/g++-include/stream.h b/gnu/lib/libg++/g++-include/stream.h
deleted file mode 100644
index f55e978734b..00000000000
--- a/gnu/lib/libg++/g++-include/stream.h
+++ /dev/null
@@ -1,13 +0,0 @@
-/* ostream.h and istream.h now separately includable */
-
-#ifndef _stream_h
-#ifdef __GNUG__
-#pragma once
-#pragma interface
-#endif
-#define _stream_h 1
-
-#include <ostream.h>
-#include <istream.h>
-
-#endif
diff --git a/gnu/lib/libg++/g++-include/streambuf.h b/gnu/lib/libg++/g++-include/streambuf.h
deleted file mode 100644
index 61a3de5e9c7..00000000000
--- a/gnu/lib/libg++/g++-include/streambuf.h
+++ /dev/null
@@ -1,165 +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 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.
-*/
-
-#ifndef _streambuf_h
-#ifdef __GNUG__
-#pragma once
-#pragma interface
-#endif
-#define _streambuf_h 1
-
-/* streambufs.
- basic streambufs and filebufs are as in Stroustrup, ch 8,
- but the base class contains virtual extensions that allow
- most capabilities of libg++ Files to be used as streambufs
- via `Filebufs'.
-*/
-
-#include <stdio.h>
-#include <builtin.h>
-#include <Fmodes.h>
-
-// see below for NO_LINE_BUFFER_STREAMBUFS
-
-#ifndef BUFSIZE
-#ifdef BUFSIZ
-#define BUFSIZE BUFSIZ
-#else
-#define BUFSIZE 1024
-#endif
-#endif
-
-enum open_mode // filebuf open modes
-{
- input=0,
- output=1,
- append=2
-};
-
-class streambuf
-{
-public:
- char* base; // start of buffer
- char* pptr; // put-pointer (and gptr fence)
- char* gptr; // get-pointer
- char* eptr; // last valid addr in buffer
-
- char alloc; // true if we own freestore alloced buffer
-
- streambuf();
- streambuf(char* buf, int buflen);
-
- virtual ~streambuf();
-
- int doallocate();
- int allocate();
-
-
- int must_overflow(int ch); // true if should call overflow
-
- virtual int overflow(int c = EOF); // flush -- return EOF if fail
- virtual int underflow(); // fill -- return EOF if fail
-
- int sgetc(); // get one char (as int) or EOF
- int snextc(); // get and advance
- void stossc(); // advance only
-
- int sputbackc(char); // unget
-
- int sputc(int c = EOF); // write one char
-
- virtual streambuf* setbuf(char* buf, int buflen, int preloaded_count = 0);
- // (not virtual in AT&T)
-
-// the following aren't in AT&T version:
-
- int sputs(const char* s); // write null-terminated str
- int sputsn(const char* s, int len); // write len bytes
-
- virtual const char* name();
-
-
- virtual streambuf* open(const char* name, open_mode m);
- virtual streambuf* open(const char* filename, io_mode m, access_mode a);
- virtual streambuf* open(const char* filename, const char* m);
- virtual streambuf* open(int filedesc, io_mode m);
- virtual streambuf* open(FILE* fileptr);
-
- virtual int is_open();
- virtual int close();
-
- virtual void error();
-};
-
-
-#if defined(__OPTIMIZE__) || defined(USE_LIBGXX_INLINES)
-
-
-inline int streambuf::must_overflow(int ch)
-{
-#ifndef NO_LINE_BUFFER_STREAMBUF
- return pptr >= eptr || ch == '\n';
-#else
- return pptr >= eptr;
-#endif
-}
-
-
-inline int streambuf::allocate()
-{
- return (base == 0)? doallocate() : 0;
-}
-
-inline int streambuf::sgetc()
-{
- return (gptr >= pptr)? underflow() : int((unsigned char)(*gptr));
-}
-
-
-inline int streambuf::snextc()
-{
- ++gptr;
- return (gptr >= pptr)? underflow() : int((unsigned char)(*gptr));
-}
-
-
-inline void streambuf::stossc()
-{
- if (gptr >= pptr) underflow(); else gptr++;
-}
-
-
-inline int streambuf::sputbackc(char ch)
-{
- return (gptr > base)? int((unsigned char)(*--gptr = ch)) : EOF;
-}
-
-inline int streambuf::sputc(int ch)
-{
- return must_overflow(ch)? overflow(ch) :
- int((unsigned char)(*pptr++ = char(ch)));
-}
-
-#endif
-
-#endif
diff --git a/gnu/lib/libg++/g++-include/string.h b/gnu/lib/libg++/g++-include/string.h
deleted file mode 100644
index e03adb7d3c0..00000000000
--- a/gnu/lib/libg++/g++-include/string.h
+++ /dev/null
@@ -1,47 +0,0 @@
-// $Id: string.h,v 1.3 1993/09/27 18:25:49 jtc Exp $
-
-#ifndef _string_h
-#define _string_h 1
-
-#include <_G_config.h>
-
-#ifndef size_t
-#define size_t _G_size_t
-#endif
-
-#ifndef NULL
-#define NULL _G_NULL
-#endif
-
-extern "C" {
-
-char* strcat(char*, const char*);
-char* strchr(const char*, int);
-int strcmp(const char*, const char*);
-int strcoll(const char*, const char*);
-char* strcpy(char*, const char*);
-size_t strcspn(const char*, const char*);
-char* strdup(const char*);
-char* strerror(int);
-// NOTE: If you get a error message from g++ that this declaration
-// conflicts with a <built-in> declaration of strlen(), that usually
-// indicates that __SIZE_TYPE__ is incorrectly defined by gcc.
-// Fix or add SIZE_TYPE in the appropriate file in gcc/config/*.h.
-size_t strlen(const char*);
-char* strncat(char*, const char*, size_t);
-int strncmp(const char*, const char*, size_t);
-char* strncpy(char*, const char*, size_t);
-char* strpbrk(const char*, const char*);
-char* strrchr(const char*, int);
-size_t strspn(const char*, const char*);
-char* strstr(const char*, const char *);
-char* strtok(char*, const char*);
-size_t strxfrm(char*, const char*, size_t);
-
-char* index(const char*, int);
-char* rindex(const char*, int);
-}
-
-#include <memory.h>
-
-#endif
diff --git a/gnu/lib/libg++/g++-include/strings.h b/gnu/lib/libg++/g++-include/strings.h
deleted file mode 100644
index ccc06eb163f..00000000000
--- a/gnu/lib/libg++/g++-include/strings.h
+++ /dev/null
@@ -1,3 +0,0 @@
-// $Id: strings.h,v 1.2 1993/08/02 17:22:19 mycroft Exp $
-
-#include <string.h>
diff --git a/gnu/lib/libg++/g++-include/swap.h b/gnu/lib/libg++/g++-include/swap.h
deleted file mode 100644
index 005cb0e4648..00000000000
--- a/gnu/lib/libg++/g++-include/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/gnu/lib/libg++/g++-include/sys/signal.h b/gnu/lib/libg++/g++-include/sys/signal.h
deleted file mode 100644
index 6ff8bad7ec7..00000000000
--- a/gnu/lib/libg++/g++-include/sys/signal.h
+++ /dev/null
@@ -1,39 +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, 675 Mass Ave, Cambridge, MA 02139, USA.
-
- $Id: signal.h,v 1.2 1993/08/02 17:21:44 mycroft Exp $
-*/
-
-/* Partly for systems that think signal.h is is sys/ */
-/* But note that some systems that use sys/signal.h to define signal.h. */
-
-#ifndef __libgxx_sys_signal_h
-#if defined(__sys_signal_h_recursive) || defined(__signal_h_recursive)
-#include_next <sys/signal.h>
-#else
-#define __sys_signal_h_recursive
-
-extern "C" {
-#define signal __hide_signal
-#include_next <sys/signal.h>
-#undef signal
-}
-
-#define __libgxx_sys_signal_h 1
-#endif
-#endif
-
diff --git a/gnu/lib/libg++/g++-include/sys/socket.h b/gnu/lib/libg++/g++-include/sys/socket.h
deleted file mode 100644
index 78b5e872296..00000000000
--- a/gnu/lib/libg++/g++-include/sys/socket.h
+++ /dev/null
@@ -1,65 +0,0 @@
-// $Id: socket.h,v 1.3 1993/08/15 16:47:00 mycroft Exp $
-
-#ifndef __libgxx_sys_socket_h
-
-#include <_G_config.h>
-
-extern "C"
-{
-#ifdef __sys_socket_h_recursive
-#include_next <sys/socket.h>
-#else
-#define __sys_socket_h_recursive
-#include <time.h>
-
-#ifdef VMS
-#include "GNU_CC_INCLUDE:[sys]socket.h"
-#else
-#include_next <sys/socket.h>
-#endif
-
-#define __libgxx_sys_socket_h 1
-
-// void* in select, since different systems use int* or fd_set*
-int accept _G_ARGS((int, struct sockaddr*, int*));
-#ifndef __NetBSD__
-int select _G_ARGS((int, void*, void*, void*, struct timeval*));
-
-int bind _G_ARGS((int, const void*, int));
-int connect _G_ARGS((int, struct sockaddr*, int));
-#else
-int select _G_ARGS((int, struct fd_set*, struct fd_set*, struct fd_set*, struct timeval*));
-
-int bind _G_ARGS((int, const struct sockaddr *, int));
-int connect _G_ARGS((int, const struct sockaddr*, int));
-#endif
-int getsockname _G_ARGS((int, struct sockaddr*, int*));
-int getpeername _G_ARGS((int, struct sockaddr*, int*));
-int getsockopt(int, int, int, void*, int*);
-int listen(int, int);
-#ifndef hpux
-int rcmd _G_ARGS((char**, int, const char*, const char*, const char*, int*));
-#endif
-int recv(int, void*, int, int);
-int recvmsg(int, struct msghdr*, int);
-int rexec(char**, int, const char*, const char*, const char*, int*);
-int rresvport(int*);
-int send _G_ARGS((int, const void*, int, int));
-int sendmsg _G_ARGS((int, const struct msghdr*, int));
-int shutdown(int, int);
-int socket(int, int, int);
-int socketpair(int, int, int, int sv[2]);
-
-#ifndef __NetBSD__
-int recvfrom _G_ARGS((int, void*, int, int, void*, int *));
-int sendto _G_ARGS((int, const void*, int, int, void*, int));
-int setsockopt _G_ARGS((int, int, int, const char*, int));
-#else
-int recvfrom _G_ARGS((int, void*, int, int, struct sockaddr*, int *));
-int sendto _G_ARGS((int, const void*, int, int, const struct sockaddr*, int));
-int setsockopt _G_ARGS((int, int, int, const void*, int));
-#endif
-#endif
-}
-
-#endif
diff --git a/gnu/lib/libg++/g++-include/sys/stat.h b/gnu/lib/libg++/g++-include/sys/stat.h
deleted file mode 100644
index 1c5ef3c9fb9..00000000000
--- a/gnu/lib/libg++/g++-include/sys/stat.h
+++ /dev/null
@@ -1,49 +0,0 @@
-// $Id: stat.h,v 1.2 1993/08/02 17:21:47 mycroft Exp $
-
-#ifndef __libgxx_sys_stat_h
-
-extern "C"
-{
-#ifdef __sys_stat_h_recursive
-#include_next <sys/stat.h>
-#else
-#define __sys_stat_h_recursive
-#include <_G_config.h>
-#define chmod __hide_chmod
-#ifdef VMS
-#include "GNU_CC_INCLUDE:[sys]stat.h"
-#else
-#include_next <sys/stat.h>
-#endif
-#undef chmod
-
-#define __libgxx_sys_stat_h 1
-
-extern int chmod _G_ARGS((const char*, _G_mode_t));
-extern int stat _G_ARGS((const char *path, struct stat *buf));
-extern int lstat _G_ARGS((const char *path, struct stat *buf));
-extern int fstat _G_ARGS((int fd, struct stat *buf));
-
-#ifndef S_ISDIR
-#define S_ISDIR(mode) (((mode) & S_IFMT) == S_IFDIR)
-#endif
-#ifndef S_ISBLK
-#define S_ISBLK(mode) (((mode) & S_IFMT) == S_IFBLK)
-#endif
-#ifndef S_ISCHR
-#define S_ISCHR(mode) (((mode) & S_IFMT) == S_IFCHR)
-#endif
-#ifndef S_ISFIFO
-#define S_ISFIFO(mode) (((mode) & S_IFMT) == S_IFFIFO)
-#endif
-#ifndef S_ISREG
-#define S_ISREG(mode) (((mode) & S_IFMT) == S_IFREG)
-#endif
-#if !defined(S_ISLNK) && defined(S_IFLNK)
-#define S_ISLNK(mode) (((mode) & S_IFMT) == S_IFLNK)
-#endif
-
-#endif
-}
-
-#endif
diff --git a/gnu/lib/libg++/g++-include/sys/time.h b/gnu/lib/libg++/g++-include/sys/time.h
deleted file mode 100644
index b08404702a3..00000000000
--- a/gnu/lib/libg++/g++-include/sys/time.h
+++ /dev/null
@@ -1,43 +0,0 @@
-// $Id: time.h,v 1.2 1993/08/02 17:21:48 mycroft Exp $
-
-#ifndef __libgxx_sys_time_h
-
-extern "C"
-{
-#ifdef __sys_time_h_recursive
-#include_next <sys/time.h>
-#else
-#define __sys_time_h_recursive
-
-// Some system (e.g Ultrix) define these in sys/time.h.
-
-#ifndef __time_h_recursive
-#define time __hide_time
-#define clock __hide_clock
-#define gmtime __hide_gmtime
-#define localtime __hide_localtime
-#define ctime __hide_ctime
-#define asctime __hide_asctime
-#define strftime __hide_strftime
-#endif
-
-#ifdef VMS
-#include "GNU_CC_INCLUDE:[sys]resourcetime.h"
-#else
-#include_next <sys/time.h>
-#endif
-#undef __sys_time_h_recursive
-
-#define __libgxx_sys_time_h 1
-
-#undef clock
-#undef ctime
-#undef gmtime
-#undef localtime
-#undef time
-#undef asctime
-#undef strftime
-#endif
-}
-
-#endif
diff --git a/gnu/lib/libg++/g++-include/sys/times.h b/gnu/lib/libg++/g++-include/sys/times.h
deleted file mode 100644
index 047a984c564..00000000000
--- a/gnu/lib/libg++/g++-include/sys/times.h
+++ /dev/null
@@ -1,22 +0,0 @@
-// $Id: times.h,v 1.2 1993/08/02 17:21:50 mycroft Exp $
-
-#ifndef __libgxx_sys_times_h
-
-extern "C"
-{
-#ifdef __sys_times_h_recursive
-#include_next <sys/times.h>
-#else
-#define __sys_times_h_recursive
-#include_next <sys/times.h>
-#define __libgxx_sys_times_h 1
-
-#include <_G_config.h>
-
-extern _G_clock_t times _G_ARGS((struct tms*));
-
-#endif
-}
-
-
-#endif
diff --git a/gnu/lib/libg++/g++-include/sys/types.h b/gnu/lib/libg++/g++-include/sys/types.h
deleted file mode 100644
index 4c87cdb5641..00000000000
--- a/gnu/lib/libg++/g++-include/sys/types.h
+++ /dev/null
@@ -1,27 +0,0 @@
-// $Id: types.h,v 1.2 1993/08/02 17:21:51 mycroft Exp $
-
-#ifndef __libgxx_sys_types_h
-
-extern "C"
-{
-#ifdef __sys_types_h_recursive
-#include_next <sys/types.h>
-#else
-
-#define __sys_types_h_recursive
-#include <stddef.h>
-
-#ifdef VMS
-#include "GNU_CC_INCLUDE:[sys]types.h"
-#else
-#include_next <sys/types.h>
-#endif
-
-#define __libgxx_sys_types_h 1
-
-#endif
-}
-
-
-#endif
-
diff --git a/gnu/lib/libg++/g++-include/sys/wait.h b/gnu/lib/libg++/g++-include/sys/wait.h
deleted file mode 100644
index babdc3ca413..00000000000
--- a/gnu/lib/libg++/g++-include/sys/wait.h
+++ /dev/null
@@ -1,44 +0,0 @@
-// $Id: wait.h,v 1.3 1993/08/15 16:47:01 mycroft Exp $
-
-#ifndef __libgxx_sys_wait_h
-
-#include <_G_config.h>
-
-extern "C" {
-#ifdef __sys_wait_h_recursive
-#include_next <sys/wait.h>
-#else
-#define __sys_wait_h_recursive
-
-
-#if _G_HAVE_SYS_WAIT
-#ifdef VMS
-#include "GNU_CC_INCLUDE:[sys]wait.h"
-#else
-#include_next <sys/wait.h>
-#endif
-#else /* !_G_HAVE_SYS_WAIT */
-/* Traditional definitions. */
-#define WEXITSTATUS(status) (((x) >> 8) & 0xFF)
-#define WIFSTOPPED(x) (((x) & 0xFF) == 0177)
-#define WIFEXITED(x) (! WIFSTOPPED(x) && WTERMSIG(x) == 0)
-#define WIFSIGNALED(x) (! WIFSTOPPED(x) && WTERMSIG(x) != 0)
-#define WTERMSIG(status) ((x) & 0x7F)
-#define WSTOPSIG(status) (((x) >> 8) & 0xFF)
-#endif /* !_G_HAVE_SYS_WAIT */
-
-#define __libgxx_sys_wait_h 1
-
-struct rusage;
-extern _G_pid_t wait _G_ARGS((int*));
-extern _G_pid_t waitpid _G_ARGS((_G_pid_t, int*, int));
-extern _G_pid_t wait3 _G_ARGS((int*, int options, struct rusage*));
-#ifndef __NetBSD__
-extern _G_pid_t wait4 _G_ARGS((int, int*, int, struct rusage*));
-#else
-extern _G_pid_t wait4 _G_ARGS((_G_pid_t, int*, int, struct rusage*));
-#endif
-#endif
-}
-
-#endif
diff --git a/gnu/lib/libg++/g++-include/time.h b/gnu/lib/libg++/g++-include/time.h
deleted file mode 100644
index 80158599191..00000000000
--- a/gnu/lib/libg++/g++-include/time.h
+++ /dev/null
@@ -1,110 +0,0 @@
-// $Id: time.h,v 1.3 1993/08/14 22:07:33 mycroft Exp $
-
-#ifndef _G_time_h
-#define _G_time_h
-
-extern "C" {
-
-#ifdef __time_h_recursive
-#include_next <time.h>
-#else
-#define __time_h_recursive
-
-#include <_G_config.h>
-
-// A clean way to use and/or define time_t might allow removal of this crud.
-#ifndef __sys_time_h_recursive
-#define time __hide_time
-#define clock __hide_clock
-#define difftime __hide_difftime
-#define gmtime __hide_gmtime
-#define localtime __hide_localtime
-#define ctime __hide_ctime
-#define asctime __hide_asctime
-#define strftime __hide_strftime
-#endif
-#define mktime __hide_mktime
-#define tzset __hide_tzset
-#define tzsetwall __hide_tzsetwall
-#define getitimer __hide_getitimer
-#define setitimer __hide_setitimer
-#define gettimeofday __hide_gettimeofday
-#define settimeofday __hide_settimeofday
-
-#ifdef VMS
- struct unix_time
- {
- long int tv_sec;
- long int tv_usec;
- };
-
- struct rusage
- {
- struct unix_time ru_utime;
- };
-
-#define RUSAGE_SELF 0 //define it, it will be unused
-#else
-#ifdef hpux
-#define _INCLUDE_POSIX_SOURCE
-#endif
-
-#include_next <time.h>
-#endif
-#undef __time_h_recursive
-
-#define time_h 1
-
-#undef time
-#undef clock
-#undef difftime
-#undef gmtime
-#undef localtime
-#undef asctime
-#undef ctime
-#undef mktime
-#undef strftime
-#undef tzset
-#undef tzsetwall
-#undef getitimer
-#undef setitimer
-#undef gettimeofday
-#undef settimeofday
-
-extern char* asctime _G_ARGS((const struct tm*));
-extern char* ctime _G_ARGS((const _G_time_t*));
-double difftime _G_ARGS((_G_time_t, _G_time_t));
-extern struct tm* gmtime _G_ARGS((const _G_time_t*));
-extern struct tm* localtime _G_ARGS((const _G_time_t*));
-extern _G_time_t mktime(struct tm*);
-extern _G_size_t strftime _G_ARGS((char*,_G_size_t,const char*,const struct tm*));
-extern void tzset();
-extern void tzsetwall();
-
-extern int getitimer(int, struct itimerval*);
-extern int setitimer _G_ARGS((int, const struct itimerval*,struct itimerval*));
-extern int gettimeofday(struct timeval*, struct timezone*);
-extern int settimeofday _G_ARGS((const struct timeval*,const struct timezone*));
-extern int stime _G_ARGS((const _G_time_t*));
-extern int dysize(int);
-
-#if defined(___AIX__)
-int clock (void);
-#elif defined(hpux)
-unsigned long clock(void);
-#else
-long clock(void);
-#endif
-_G_time_t time(_G_time_t*);
-unsigned ualarm(unsigned, unsigned);
-#ifndef __NetBSD__
-unsigned usleep(unsigned);
-void profil _G_ARGS((unsigned short*, _G_size_t, unsigned int, unsigned));
-#else
-void usleep(unsigned);
-int profil _G_ARGS((char*, int, int, int));
-#endif
-
-#endif
-}
-#endif
diff --git a/gnu/lib/libg++/g++-include/unistd.h b/gnu/lib/libg++/g++-include/unistd.h
deleted file mode 100644
index e3cd0685fb8..00000000000
--- a/gnu/lib/libg++/g++-include/unistd.h
+++ /dev/null
@@ -1,189 +0,0 @@
-// $Id: unistd.h,v 1.3 1993/08/14 22:07:34 mycroft Exp $
-
-#ifndef _G_unistd_h
-#define _G_unistd_h 1
-
-#include <_G_config.h>
-
-extern "C" {
-
-#if _G_HAVE_UNISTD
-#ifndef _G_USE_PROTOS
-#define chmod __hide_chmod
-#define chown __hide_chown
-#define execl __hide_execl
-#define execlp __hide_execlp
-#define execle __hide_execle
-#define fchown __hide_fchown
-#define ioctl __hide_ioctl
-#define setgid __hide_setgid
-#define setuid __hide_setuid
-#endif
-#ifdef _AIX
-// AIX's unistd.h defines int rename (const char *old, const char *new).
-// This is not legal ANSI. It causes a C++ syntax error (because of 'new').
-#define new __new
-#endif
-#include_next <unistd.h>
-#ifdef _AIX
-#undef new
-#endif
-#ifndef _G_USE_PROTOS
-#undef chmod
-#undef chown
-#undef execl
-#undef execle
-#undef execlp
-#undef fchown
-#undef ioctl
-#undef setgid
-#undef setuid
-#endif
-#else
-#ifndef SEEK_SET
-#define SEEK_SET 0
-#define SEEK_CUR 1
-#define SEEK_END 2
-#endif
-
-#ifndef F_OK
-#define F_OK 0
-#endif
-#ifndef X_OK
-#define X_OK 1
-#endif
-#ifndef W_OK
-#define W_OK 2
-#endif
-#ifndef R_OK
-#define R_OK 4
-#endif
-#endif
-
-#ifdef __GNUG__
-extern void volatile _exit(int);
-#else
-void _exit(int);
-#endif
-
-extern unsigned alarm _G_ARGS((unsigned));
-#ifndef __NetBSD__
-extern int brk _G_ARGS((void*));
-#else
-extern char* brk _G_ARGS((const char*));
-#endif
-extern int chdir _G_ARGS((const char*));
-extern int chmod _G_ARGS((const char*, _G_mode_t));
-extern int chown (const char*, _G_uid_t, _G_gid_t);
-extern int close _G_ARGS((int));
-extern char* crypt _G_ARGS((const char*, const char*));
-extern int dup _G_ARGS((int));
-extern int dup2 _G_ARGS((int, int));
-#ifndef __NetBSD__
-extern void encrypt _G_ARGS((char*, int));
-#else
-extern int encrypt _G_ARGS((char*, int));
-#endif
-extern int execl (const char*, const char *, ...);
-extern int execle (const char*, const char *, ...);
-extern int execlp (const char*, const char*, ...);
-#ifndef __NetBSD__
-extern int exect _G_ARGS((const char*, const char**, char**));
-extern int execv _G_ARGS((const char*, const char * const *));
-extern int execve _G_ARGS((const char*, const char * const *, const char * const *));
-extern int execvp _G_ARGS((const char*, const char * const *));
-extern int fchown (int, _G_uid_t, _G_gid_t);
-#else
-extern int exect _G_ARGS((const char*, char * const*, char * const *));
-extern int execv _G_ARGS((const char*, char * const *));
-extern int execve _G_ARGS((const char*, char * const *, char * const *));
-extern int execvp _G_ARGS((const char*, char * const *));
-extern int fchown (int, int, int);
-#endif
-extern _G_pid_t fork _G_ARGS((void));
-extern int fsync _G_ARGS((int));
-extern int ftruncate _G_ARGS((int, _G_off_t));
-extern char* getcwd _G_ARGS((char*, _G_size_t));
-extern int getdomainname _G_ARGS((char*, int));
-extern int getdtablesize _G_ARGS((void));
-#ifndef __NetBSD__
-extern int getgroups _G_ARGS((int, _G_gid_t*));
-#else
-extern int getgroups _G_ARGS((int, int*));
-#endif
-extern _G_uid_t geteuid _G_ARGS((void));
-extern _G_gid_t getegid _G_ARGS((void));
-extern _G_gid_t getgid _G_ARGS((void));
-extern long gethostid _G_ARGS((void));
-extern int gethostname _G_ARGS((char*, int));
-extern _G_pid_t getpgrp _G_ARGS((...));
-extern _G_pid_t getpid _G_ARGS((void));
-extern _G_pid_t getppid _G_ARGS((void));
-extern char* getlogin _G_ARGS((void));
-extern char* getpass _G_ARGS((const char*));
-extern _G_uid_t getuid _G_ARGS((void));
-#ifndef __NetBSD__
-extern int ioctl (int, int, ... );
-#else
-extern int ioctl (int, unsigned long, ... );
-#endif
-extern int isatty _G_ARGS((int));
-extern int link _G_ARGS((const char*, const char*));
-extern int lockf _G_ARGS((int, int, long));
-extern int mkstemp _G_ARGS((char*));
-extern char* mktemp _G_ARGS((char*));
-extern int nice _G_ARGS((int));
-extern int pause _G_ARGS((void));
-extern int pipe _G_ARGS((int*));
-extern int readlink _G_ARGS((const char*, char*, int));
-extern int rename _G_ARGS((const char*, const char*));
-extern int rmdir _G_ARGS((const char*));
-#if defined( __OSF1__ ) || defined (__NetBSD__)
-extern char* sbrk _G_ARGS((int));
-#else
-extern void* sbrk _G_ARGS((int));
-#endif
-extern int syscall _G_ARGS((int, ...));
-extern int setgid (_G_gid_t);
-extern int sethostname _G_ARGS((const char*, int));
-#ifdef _G_SYSV
-extern _G_pid_t setpgrp _G_ARGS((void));
-extern _G_pid_t setsid _G_ARGS((void));
-#else
-#ifndef __NetBSD__
-extern _G_pid_t setpgrp _G_ARGS((_G_pid_t, _G_pid_t));
-#else
-extern _G_pid_t setsid _G_ARGS((void));
-extern int setpgrp _G_ARGS((_G_pid_t, _G_pid_t));
-#endif
-#endif
-extern int setregid _G_ARGS((int, int));
-extern int setreuid _G_ARGS((int, int));
-extern int setuid (_G_uid_t);
-extern unsigned sleep _G_ARGS((unsigned));
-extern void swab _G_ARGS((void*, void*, int));
-extern int symlink _G_ARGS((const char*, const char*));
-extern long sysconf _G_ARGS((int));
-extern int truncate _G_ARGS((const char*, _G_off_t));
-extern char* ttyname _G_ARGS((int));
-extern int ttyslot _G_ARGS((void));
-//extern int umask _G_ARGS((int)); /* commented out for now; wrong for SunOs4.1 */
-extern int unlink _G_ARGS((const char*));
-#ifndef __NetBSD__
-extern _G_pid_t vfork _G_ARGS((void));
-#else
-extern int vfork _G_ARGS((void));
-#endif
-extern int vadvise _G_ARGS((int));
-extern int vhangup _G_ARGS((void));
-extern _G_off_t lseek _G_ARGS((int, long, int));
-extern _G_ssize_t read _G_ARGS((int, void*, _G_size_t));
-extern _G_ssize_t write _G_ARGS((int, const void*, _G_size_t));
-extern int access _G_ARGS((const char*, int));
-#ifndef hpux
-extern int flock _G_ARGS((int, int));
-#endif
-
-}
-
-#endif
diff --git a/gnu/lib/libg++/libg++/SFile.cc b/gnu/lib/libg++/libg++/SFile.cc
deleted file mode 100644
index 951196f3f8e..00000000000
--- a/gnu/lib/libg++/libg++/SFile.cc
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
-Copyright (C) 1988 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 <SFile.h>
-
-SFile::SFile() {}
-SFile::~SFile() {}
-
-SFile::SFile(const char* filename, int size, io_mode m, access_mode a)
-: (filename, m, a)
-{
- sz = size;
-}
-
-SFile::SFile(const char* filename, int size, const char* m)
-: (filename, m)
-{
- sz = size;
-}
-
-SFile::SFile(int filedesc, int size, io_mode m)
-: (filedesc, m)
-{
- sz = size;
-}
-
-SFile::SFile(FILE* fileptr, int size)
-: (fileptr)
-{
- sz = size;
-}
diff --git a/gnu/lib/libg++/libg++/Sample.cc b/gnu/lib/libg++/libg++/Sample.cc
deleted file mode 100644
index c5edf108b18..00000000000
--- a/gnu/lib/libg++/libg++/Sample.cc
+++ /dev/null
@@ -1,241 +0,0 @@
-// @(#)Sample.cc 6.2 (Berkeley) 2/25/91
-
-// Modified for Berkeley Unix by Donn Seeley, donn@okeeffe.berkeley.edu
-
-// 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 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 <stream.h>
-#include <SmplStat.h>
-#include <math.h>
-
-// 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;
- 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;
- minValue = HUGE;
-}
-
-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;
- double t = tval(double(100 + interval) * 0.005, df);
- if (t == HUGE)
- return t;
- else
- return (t * stdDev()) / sqrt(double(n));
-}
-
-double
-SampleStatistic::confidence(double p_value)
-{
- int df = n - 1;
- if (df <= 0) return HUGE;
- double t = tval((1.0 + p_value) * 0.5, df);
- if (t == HUGE)
- 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; /* 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) {
- 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/gnu/lib/libg++/libg++/ctype.cc b/gnu/lib/libg++/libg++/ctype.cc
deleted file mode 100644
index 3401290f589..00000000000
--- a/gnu/lib/libg++/libg++/ctype.cc
+++ /dev/null
@@ -1,4 +0,0 @@
-#ifdef __GNUG__
-#pragma implementation
-#endif
-#include <ctype.h>
diff --git a/gnu/lib/libg++/libg++/curses.cc b/gnu/lib/libg++/libg++/curses.cc
deleted file mode 100644
index 943fb380f8e..00000000000
--- a/gnu/lib/libg++/libg++/curses.cc
+++ /dev/null
@@ -1,4 +0,0 @@
-#ifdef __GNUG__
-#pragma implementation
-#endif
-#include <curses.h>
diff --git a/gnu/lib/libg++/libg++/delete.cc b/gnu/lib/libg++/libg++/delete.cc
deleted file mode 100644
index 7633587a018..00000000000
--- a/gnu/lib/libg++/libg++/delete.cc
+++ /dev/null
@@ -1,38 +0,0 @@
-#ifndef NO_LIBGXX_MALLOC
-
-// This may look like C code, but it is really -*- C++ -*-
-
-/*
-Copyright (C) 1989 Free Software Foundation
- written by Doug Lea (dl@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 <stddef.h>
-#include <malloc.h>
-
-void operator delete(void* ptr)
-{
- free (ptr);
-}
-
-#endif
diff --git a/gnu/lib/libg++/libg++/filebuf.cc b/gnu/lib/libg++/libg++/filebuf.cc
deleted file mode 100644
index 8c751ca9dc5..00000000000
--- a/gnu/lib/libg++/libg++/filebuf.cc
+++ /dev/null
@@ -1,192 +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.
-*/
-
-#if 1
-#ifdef __GNUG__
-#pragma implementation
-#endif
-#endif
-
-#include <std.h>
-#include <sys/file.h> // needed to determine values of O_RDONLY...
-#include <filebuf.h>
-#include <open.h>
-
-filebuf::filebuf()
- :streambuf(), fd(-1), opened(0) {}
-
-filebuf::filebuf(int newfd)
- : streambuf(), fd(newfd), opened(1) {}
-
-filebuf::filebuf(int newfd, char* buf, int buflen)
- : streambuf(buf, buflen), fd(newfd), opened(1) {}
-
-filebuf::filebuf(const char* filename, io_mode m, access_mode a)
- : streambuf()
-{
- open(filename, m, a);
-}
-
-filebuf::filebuf(const char* filename, const char* m)
- : streambuf()
-{
- open(filename, m);
-}
-
-filebuf::filebuf(int filedesc, io_mode m)
- : streambuf()
-{
- open(filedesc, m);
-}
-
-filebuf::filebuf(FILE* fileptr)
- : streambuf()
-{
- open(fileptr);
-}
-
-int filebuf::is_open()
-{
- return opened;
-}
-
-int filebuf::close()
-{
- int was = opened;
- if (was) ::close(fd);
- opened = 0;
- return was;
-}
-
-streambuf* filebuf::open(const char* filename, open_mode m)
-{
- if (opened) return 0;
- int mode = -1; // any illegal value
- switch (m)
- {
- case input: mode = O_RDONLY;
- break;
- case output: mode = O_WRONLY | O_CREAT | O_TRUNC;
- break;
- case append: mode = O_APPEND | O_CREAT | O_WRONLY;
- break;
- }
- fd = ::open(filename, mode, 0666);
- if (opened = (fd >= 0))
- {
- allocate();
- return this;
- }
- else
- return 0;
-}
-
-
-streambuf* filebuf::open(const char* filename, io_mode m, access_mode a)
-{
- int open_arg = open_cmd_arg(m, a);
- if (open_arg == -1) return 0;
- fd = ::open(filename, open_arg, 0666);
- if (opened = (fd >= 0))
- {
- allocate();
- return this;
- }
- else
- return 0;
-
-}
-
-streambuf* filebuf::open(const char* filename, const char* m)
-{
- int open_arg = open_cmd_arg(m);
- if (open_arg == -1) return 0;
- fd = ::open(filename, open_arg, 0666);
- if (opened = (fd >= 0))
- {
- allocate();
- return this;
- }
- else
- return 0;
-}
-
-streambuf* filebuf::open(int filedesc, io_mode m)
-{
- int open_arg = open_cmd_arg(m, a_use);
- if (open_arg == -1) return 0;
- fd = ::open(name(), open_arg, 0666);
- if (opened = (fd >= 0))
- {
- allocate();
- return this;
- }
- else
- return 0;
-}
-
-streambuf* filebuf::open(FILE* fileptr)
-{
- opened = fileptr != 0;
- fd = fileno(fileptr);
- return this;
-}
-
-int filebuf::underflow()
-{
- if (!opened) return EOF;
- if (base == 0) allocate();
- int nwanted = eptr - base + 1;
- int nread = ::read(fd, base, nwanted);
- if (nread >= 0)
- {
- gptr = base;
- pptr = base + nread;
- }
- return (nread <= 0)? EOF : int(*gptr);
-}
-
-int filebuf::overflow(int ch)
-{
- if (!opened) return EOF;
- if (base == 0) allocate();
- if (ch != EOF) // overflow *must* be called before really full
- *pptr++ = (char)(ch);
-
- // loop, in case write can't handle full request
- // From: Rene' Seindal <seindal@diku.dk>
-
- int w, n, t;
- for (w = t = 0, n = pptr - base; n > 0; n -= w, t += w)
- {
- if ((w = ::write(fd, base + t, n)) < 0)
- break;
- }
-
- pptr = base;
- return (n == 0 && w >= 0)? 0 : EOF;
-}
-
-filebuf::~filebuf()
-{
- close();
-}
diff --git a/gnu/lib/libg++/libg++/form.cc b/gnu/lib/libg++/libg++/form.cc
deleted file mode 100644
index ae373ed13d4..00000000000
--- a/gnu/lib/libg++/libg++/form.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 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 <builtin.h>
-#include <stdio.h>
-#include <stdarg.h>
-#include <AllocRing.h>
-
-extern AllocRing _libgxx_fmtq;
-
-char* form(const char* fmt ...)
-{
- va_list args;
- va_start(args, fmt);
- char* fmtbase = (char *) _libgxx_fmtq.alloc(BUFSIZ);
-#ifndef HAVE_VPRINTF
- FILE b;
-#ifdef VMS
- b->_flag = _IOWRT|_IOSTRG;
- b->_ptr = fmtbase;
- b->_cnt = BUFSIZ-1;
-#else
- b._flag = _IOWRT|_IOSTRG;
- b._ptr = fmtbase;
- b._cnt = BUFSIZ-1;
-#endif
- _doprnt(fmt, args, &b);
- putc('\0', &b);
-#else
- vsprintf(fmtbase, fmt, args);
-#endif
- va_end(args);
- return fmtbase;
-}
diff --git a/gnu/lib/libg++/libg++/g++.order b/gnu/lib/libg++/libg++/g++.order
deleted file mode 100644
index 3639cd50972..00000000000
--- a/gnu/lib/libg++/libg++/g++.order
+++ /dev/null
@@ -1,70 +0,0 @@
-std.o
-math.o
-curses.o
-ctype.o
-compare.o
-timer.o
-str.o
-sqrt.o
-pow.o
-ioob.o
-fmtq.o
-lg.o
-itoa.o
-hash.o
-gcd.o
-form.o
-error.o
-dtoa.o
-chr.o
-delete.o
-new.o
-gnulib3.o
-xyzzy.o
-EH2.o
-EH.o
-GetOpt.o
-CursesW.o
-Fix24.o
-Fix16.o
-Fix.o
-RndInt.o
-MLCG.o
-ACG.o
-RNG.o
-min.o
-max.o
-Binomial.o
-Geom.o
-HypGeom.o
-Poisson.o
-Uniform.o
-DiscUnif.o
-Erlang.o
-Weibull.o
-NegExp.o
-Normal.o
-SmplStat.o
-SmplHist.o
-LogNorm.o
-BitString.o
-BitSet.o
-Random.o
-Complex.o
-Rational.o
-Integer.o
-String.o
-Regex.o
-regex.o
-builtin.o
-SFile.o
-PlotFile.o
-open.o
-Filebuf.o
-istream.o
-ostream.o
-File.o
-Obstack.o
-AllocRing.o
-filebuf.o
-streambuf.o
diff --git a/gnu/lib/libg++/libg++/gnulib3.c b/gnu/lib/libg++/libg++/gnulib3.c
deleted file mode 100644
index d8d212e40fc..00000000000
--- a/gnu/lib/libg++/libg++/gnulib3.c
+++ /dev/null
@@ -1,109 +0,0 @@
-
-#ifndef NO_GNULIB3 /* skip entire file if NO_GNULIB3 */
-
-typedef struct set_vector
-{
- int length;
- int vector[1];
- /* struct set_vector *next; */
-} set_vector;
-
-set_vector __CTOR_LIST__;
-set_vector __DTOR_LIST__;
-set_vector *__dlp;
-int __dli;
-
-extern void exit (int);
-extern void __do_global_init ();
-extern void __do_global_cleanup ();
-extern void on_exit(void*, void*);
-extern void _cleanup();
-extern void _exit(int);
-
-
-#if defined(i386) && !defined(sequent)
-#define COFF
-#endif
-
-#ifdef COFF_ENCAPSULATE
-#undef COFF
-#endif
-
-/*
- ON_EXIT macro commented out - dl
- Sun on_exit doesn't get linked in right!!!
-*/
-
-#if 0
-#if defined(sun)
-#define ON_EXIT(PROCP, ARG) \
- do { extern void PROCP (); on_exit (PROCP, ARG); } while (0)
-#endif
-#endif
-
-int
-__main ()
-{
- /* Gross hack for GNU ld. This is defined in `builtin.cc'
- from libg++. */
-#ifndef COFF
- extern int __1xyzzy__;
-#endif
-
-#ifdef ON_EXIT
-
-#ifdef sun
- ON_EXIT (_cleanup, 0);
-#endif
-
- ON_EXIT (__do_global_cleanup, 0);
-
-#endif
- __dli = __DTOR_LIST__.length;
- __dlp = &__DTOR_LIST__;
-#ifndef COFF
- __do_global_init (&__1xyzzy__);
-#else
- __do_global_init ();
-#endif
-}
-
-#ifndef ON_EXIT
-
-void
-exit (status)
- int status;
-{
- __do_global_cleanup ();
- _cleanup ();
- _exit (status);
-}
-#endif
-
-void
-__do_global_init ()
-{
- register int i, len;
- register void (**ppf)() = (void (**)())__CTOR_LIST__.vector;
-
- len = __CTOR_LIST__.length;
- for (i = 0; i < len; i++)
- (*ppf[i])();
-}
-
-void
-__do_global_cleanup ()
-{
- while (__dlp)
- {
- while (--__dli >= 0)
- {
- void (*pf)() = (void (*)())__dlp->vector[__dli];
- (*pf)();
- }
- __dlp = (struct set_vector *)__dlp->vector[__dlp->length];
- if (__dlp) __dli = __dlp->length;
- }
-}
-
-#endif
diff --git a/gnu/lib/libg++/libg++/istream.cc b/gnu/lib/libg++/libg++/istream.cc
deleted file mode 100644
index 4898ab6d628..00000000000
--- a/gnu/lib/libg++/libg++/istream.cc
+++ /dev/null
@@ -1,507 +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 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.
-*/
-
-/* *** Version 1.2 -- nearly 100% AT&T 1.2 compatible *** */
-
-#ifdef __GNUG__
-#pragma implementation
-#endif
-#include <stream.h>
-#include <stdarg.h>
-#include <values.h>
-#include <ctype.h>
-#include <Obstack.h>
-
-
-istream::istream(streambuf* s, int sk, ostream* t)
- : bp(s), state(_good), skipws(sk), tied_to(t), ownbuf(0) {}
-
-istream::istream(int sz, char* buf, int sk, ostream* t)
- : state(_good), skipws(sk), tied_to(t), ownbuf(1)
-{
- bp = new streambuf;
- if (buf == 0)
- {
- bp->alloc = 1;
- buf = new char[sz];
- }
- else
- bp->alloc = 0;
-
- bp->setbuf(buf, sz, sz);
-}
-
-istream::~istream()
-{
- if (ownbuf) delete bp;
-}
-
-istream::istream(const char* filename, io_mode m, access_mode a, int sk, ostream* t)
- : state(_good), skipws(sk), tied_to(t), ownbuf(1)
-{
- bp = new filebuf(filename, m, a);
-}
-
-istream::istream(const char* filename, const char* m, int sk, ostream* t)
- : state(_good), skipws(sk), tied_to(t), ownbuf(1)
-{
- bp = new filebuf(filename, m);
-}
-
-istream::istream(int filedesc, io_mode m, int sk, ostream* t)
- : state(_good), skipws(sk), tied_to(t), ownbuf(1)
-{
- bp = new filebuf(filedesc, m);
-}
-
-istream::istream(FILE* fileptr, int sk, ostream* t)
- : state(_good), skipws(sk), tied_to(t), ownbuf(1)
-{
- bp = new filebuf(fileptr);
-
-}
-
-istream::istream(int filedesc, int sk, ostream* t)
- : state(_good), skipws(sk), tied_to(t), ownbuf(1)
-{
- bp = new filebuf(filedesc);
-}
-
-istream::istream(int filedesc, char* buf, int buflen, int sk, ostream* t)
- : state(_good), skipws(sk), tied_to(t), ownbuf(1)
-{
- bp = new filebuf(filedesc, buf, buflen);
-}
-
-istream& istream::open(const char* filename, io_mode m, access_mode a)
-{
- return failif(bp->open(filename, m, a) == 0);
-}
-
-istream& istream::open(const char* filename, const char* m)
-{
- return failif(bp->open(filename, m) == 0);
-}
-
-istream& istream::open(int filedesc, io_mode m)
-{
- return failif(bp->open(filedesc, m) == 0);
-}
-
-istream& istream::open(FILE* fileptr)
-{
- return failif(bp->open(fileptr) == 0);
-}
-
-istream& istream::open(const char* filenam, open_mode m)
-{
- return failif(bp->open(filenam, m) == 0);
-}
-
-istream& istream::get(char& c)
-{
- if (good())
- {
- if(tied_to != 0) tied_to->flush();
- int ch = bp->sgetc();
- if (ch == EOF)
- set(_eof);
- else
- {
- c = ch;
- bp->stossc();
- }
- }
- return *this;
-}
-
-
-istream& istream::operator >> (whitespace&)
-{
- if (good())
- {
- int ch;
- if(tied_to != 0) tied_to->flush();
- while (((ch = bp->sgetc()) != EOF) && isspace(ch)) bp->stossc();
- if (ch == EOF) set(_eof);
- }
- return *this;
-}
-
-
-istream& istream::operator >> (char& c)
-{
- if (skipws) (*this >> WS);
- return get(c);
-}
-
-istream& istream::get(char* s, int n, char terminator)
-{
- if (!readable())
- {
- set(_fail);
- return *this;
- }
-
- char ch = 0;
- char* start = s;
- if (--n > 0 && get(ch))
- {
- if (ch == terminator)
- unget(ch);
- else
- {
- *s++ = ch; --n;
- while (n-- > 0 && get(ch))
- {
- if (ch == terminator)
- {
- unget(ch);
- break;
- }
- else
- *s++ = ch;
- }
- }
- }
-
- *s = 0;
- if (s != start) clear();
- return *this;
-}
-
-
-istream& istream::operator >> (char* s)
-{
- if (!readable() || s == 0)
- {
- set(_fail);
- return *this;
- }
-
- if (skipws && !(*this >> WS)) return *this;
-
- char ch;
- char* start = s;
- if (get(ch))
- {
- *s++ = ch;
- while (get(ch))
- {
- if (isspace(ch))
- {
- unget(ch);
- break;
- }
- else
- *s++ = ch;
- }
- }
-
- *s = 0;
- if (s != start) clear();
- return *this;
-}
-
-
-istream& istream::getline(char* s, int n, char terminator)
-{
- if (!readable())
- {
- set(_fail);
- return *this;
- }
- char* start = s;
- char ch;
- while (--n > 0 && get(ch) && ((*s++ = ch) != terminator));
-
- *s = 0;
- if (s != start) clear();
- return *this;
-}
-
-// from Doug Schmidt
-
-// This should probably be a page size....
-#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 *istream::readline (int chunk_number, char terminator)
-{
- char buf[CHUNK_SIZE];
- register char *bufptr = buf;
- register char *ptr;
- char ch;
- int continu;
-
- while ((continu = !!get(ch)) && ch != terminator) /* fill the current buffer */
- {
- *bufptr++ = ch;
- if (bufptr - buf >= CHUNK_SIZE) /* prepend remainder to ptr buffer */
- {
- if (ptr = readline (chunk_number + 1, terminator))
-
- for (; bufptr != buf; *--ptr = *--bufptr);
-
- return ptr;
- }
- }
- if (!continu && bufptr == buf)
- return NULL;
-
- int size = (chunk_number * CHUNK_SIZE + bufptr - buf) + 1;
-
- if (ptr = new char[size])
- {
-
- for (*(ptr += (size - 1)) = '\0'; bufptr != buf; *--ptr = *--bufptr)
- ;
-
- return ptr;
- }
- else
- return NULL;
-}
-
-/* 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 terminator)
-{
- return failif(!readable() || !(*s = readline (0, terminator)));
-}
-
-istream& istream::operator >> (long& y)
-{
- if (!readable())
- {
- set(_bad);
- return *this;
- }
-
- int got_one = 0;
- char sgn = 0;
- char ch;
- y = 0;
- if (skipws) *this >> WS;
- if (!good())
- {
- set(_bad);
- return *this;
- }
- while (get(ch))
- {
- if (ch == '-')
- {
- if (sgn == 0 && got_one == 0)
- sgn = '-';
- else
- break;
- }
- else if (ch >= '0' && ch <= '9')
- y = y * 10 + ((got_one = ch) - '0');
- else
- break;
- }
- if (good())
- unget(ch);
- if (!got_one)
- set(_bad);
- else
- clear();
-
- if (sgn == '-')
- y = -y;
-
- return *this;
-}
-
-istream& istream::operator >> (unsigned long& y)
-{
- if (!readable())
- {
- set(_bad);
- return *this;
- }
-
- int got_one = 0;
- char ch;
- y = 0;
- if (skipws) *this >> WS;
- if (!good())
- while (get(ch))
- {
- if (ch >= '0' && ch <= '9')
- y = y * 10 + ((got_one = ch) - '0');
- else
- break;
- }
- if (good())
- unget(ch);
- if (!got_one)
- set(_bad);
- else
- clear();
- return *this;
-}
-
-
-/* for input to a double, we must trust atof (cannot even use
-the better strtod since it is not universally supported). So
-guaranteed legal chars are gathered up into an obstack. The
-only possible, undiagnosable error is that the input number
-might give a floating overflow or underflow inside atof.
-I know of no way to avoid this */
-
-extern Obstack _libgxx_io_ob;
-
-istream& istream::operator >> (double & y)
-{
- if (!readable())
- {
- set(_bad);
- return *this;
- }
-
-
- char seenint = 0;
- char seendec = 0;
- char seenexp = 0;
- char seensgn = 0;
- char seene = 0;
- char seenexpsgn = 0;
- char seendot = 0;
- char ch;
-
- if (skipws) *this >> WS;
- if (!good())
- {
- set(_bad);
- return *this;
- }
- while (get(ch))
- {
- if (ch == '-' || ch == '+')
- {
- if (seene && !seenexpsgn)
- _libgxx_io_ob.grow(seenexpsgn = ch);
- else if (!seensgn && !seenint)
- _libgxx_io_ob.grow(seensgn = ch);
- else
- break;
- }
- else if (ch == '.' && !seendot)
- {
- _libgxx_io_ob.grow(seendot = ch);
- }
- else if ((ch == 'e' || ch == 'E') && !seene)
- {
- _libgxx_io_ob.grow(seene = ch);
- }
- else if (ch >= '0' && ch <= '9')
- {
- _libgxx_io_ob.grow(ch);
- if (seene) seenexp = ch;
- else if (seendot) seendec = ch;
- else seenint = ch;
- }
- else
- break;
- }
- char* str = (char *) _libgxx_io_ob.finish(0);
- if (good())
- unget(ch);
- if ((seenint || seendec) && (!seene || seenexp))
- y = atof(str);
- else
- set(_bad);
- _libgxx_io_ob.free(str);
- return *this;
-}
-
-istream& istream::operator >> (int& y)
-{
- long l; (*this >> l); y = int(l); return *this;
-}
-
-istream& istream:: operator >> (unsigned int& y)
-{
- long l; (*this >> l); y = (unsigned int)(l); return *this;
-}
-
-istream& istream:: operator >> (short& y)
-{
- long l; (*this >> l); y = short(l); return *this;
-}
-
-istream& istream:: operator >> (unsigned short& y)
-{
- long l; (*this >> l); y = (unsigned short)(l); return *this;
-}
-
-istream& istream:: operator >> (float& y)
-{
- double d; (*this >> d); y = float(d); return *this;
-}
-
-const char* istream::name()
-{
- return bp->name();
-}
-
-void istream::error()
-{
- bp->error();
-}
-
-ostream* istream::tie(ostream* s)
-{
- ostream* was = tied_to; tied_to = s; return was;
-}
-
-void istream::_flush()
-{
- if(tied_to != 0) tied_to->flush();
-}
-
-
-//--------------------------------------------------------------
-
-extern ostream cout;
-
-#if 0 /* BSD 4.4 */
-
-istream cin(stdin, 1, &cout);
-
-#else
-
-static char cinbuf[BUFSIZE];
-istream cin (0, cinbuf, BUFSIZE, 1, &cout);
-
-#endif
-
-whitespace WS;
diff --git a/gnu/lib/libg++/libg++/itoa.cc b/gnu/lib/libg++/libg++/itoa.cc
deleted file mode 100644
index 489f252e29d..00000000000
--- a/gnu/lib/libg++/libg++/itoa.cc
+++ /dev/null
@@ -1,226 +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 <values.h>
-#include <builtin.h>
-#include <AllocRing.h>
-
-extern AllocRing _libgxx_fmtq;
-
-char* itoa(long x, int base, int width)
-{
- int wrksiz;
- if (base == 10)
- wrksiz = width + 13;
- else
- wrksiz = (BITS(long) + 1) / lg(base) + 1 + width + 1;
-
- char* fmtbase = (char *) _libgxx_fmtq.alloc(wrksiz);
- char* e = fmtbase + wrksiz - 1;
- char* s = e;
- *--s = 0;
- char sgn = 0;
-
- if (x == 0)
- *--s = '0';
- else
- {
- unsigned int z;
- if (x < 0)
- {
- sgn = '-';
- z = -x;
- }
- else
- z = x;
- while (z != 0)
- {
- char ch = char(z % base);
- z = z / base;
- if (ch >= 10)
- ch += 'a' - 10;
- else
- ch += '0';
- *--s = ch;
- }
- }
-
- if (sgn) *--s = sgn;
- int w = e - s - 1;
- while (w++ < width)
- *--s = ' ';
- return s;
-}
-
-char* itoa(unsigned long x, int base, int width)
-{
- int wrksiz;
- if (base == 10)
- wrksiz = width + 13;
- else
- wrksiz = (BITS(long) + 1) / lg(base) + 1 + width + 1;
-
- char* fmtbase = (char *) _libgxx_fmtq.alloc(wrksiz);
- char* e = fmtbase + wrksiz - 1;
- char* s = e;
- *--s = 0;
-
- if (x == 0)
- *--s = '0';
- else
- {
- unsigned int b = base;
- while (x != 0)
- {
- char ch = char(x % b);
- x = x / b;
- if (ch >= 10)
- ch += 'a' - 10;
- else
- ch += '0';
- *--s = ch;
- }
- }
-
- int w = e - s - 1;
- while (w++ < width)
- *--s = ' ';
- return s;
-}
-
-#ifdef __GNUG__
-#ifndef VMS
-char* itoa(long long x, int base, int width)
-{
- int wrksiz;
- if (base == 10)
- wrksiz = width + 23;
- else
- wrksiz = (BITS(long long) + 1) / lg(base) + 1 + width + 1;
-
- char* fmtbase = (char *) _libgxx_fmtq.alloc(wrksiz);
- char* e = fmtbase + wrksiz - 1;
- char* s = e;
- *--s = 0;
- char sgn = 0;
-
- if (x == 0)
- *--s = '0';
- else
- {
- long long z;
- if (x < 0)
- {
- sgn = '-';
- z = -x;
- }
- else
- z = x;
- while (z != 0)
- {
- char ch = char(z % base);
- z = z / base;
- if (ch >= 10)
- ch += 'a' - 10;
- else
- ch += '0';
- *--s = ch;
- }
- }
-
- if (sgn) *--s = sgn;
- int w = e - s - 1;
- while (w++ < width)
- *--s = ' ';
- return s;
-}
-
-char* itoa(unsigned long long x, int base, int width)
-{
- int wrksiz;
- if (base == 10)
- wrksiz = width + 23;
- else
- wrksiz = (BITS(long long) + 1) / lg(base) + 1 + width + 1;
-
- char* fmtbase = (char *) _libgxx_fmtq.alloc(wrksiz);
- char* e = fmtbase + wrksiz - 1;
- char* s = e;
- *--s = 0;
-
- if (x == 0)
- *--s = '0';
- else
- {
- unsigned int b = base;
- while (x != 0)
- {
- char ch = char(x % b);
- x = x / b;
- if (ch >= 10)
- ch += 'a' - 10;
- else
- ch += '0';
- *--s = ch;
- }
- }
-
- int w = e - s - 1;
- while (w++ < width)
- *--s = ' ';
- return s;
-}
-#endif
-#endif
-
-char* hex(long i, int width)
-{
- return itoa(i, 16, width);
-}
-
-char* oct(long i, int width)
-{
- return itoa(i, 8, width);
-}
-
-char* dec(long i, int width)
-{
- return itoa(i, 10, width);
-}
-
-char* hex(unsigned long i, int width)
-{
- return itoa(i, 16, width);
-}
-
-char* oct(unsigned long i, int width)
-{
- return itoa(i, 8, width);
-}
-
-char* dec(unsigned long i, int width)
-{
- return itoa(i, 10, width);
-}
diff --git a/gnu/lib/libg++/libg++/malloc.c b/gnu/lib/libg++/libg++/malloc.c
deleted file mode 100644
index 071ee94a594..00000000000
--- a/gnu/lib/libg++/libg++/malloc.c
+++ /dev/null
@@ -1,1261 +0,0 @@
-/*
-Copyright (C) 1989 Free Software Foundation
- written by Doug Lea (dl@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.
-*/
-
-
-
-#ifndef NO_LIBGXX_MALLOC /* ignore whole file otherwise */
-
-/* compile with -DMALLOC_STATS to collect statistics */
-/* collecting statistics slows down malloc by at least 15% */
-
-#ifdef MALLOC_STATS
-#define UPDATE_STATS(ARGS) {ARGS;}
-#else
-#define UPDATE_STATS(ARGS)
-#endif
-
-/* History
-
-
- Tue Jan 16 04:54:27 1990 Doug Lea (dl at g.oswego.edu)
-
- version 1 released in libg++
-
- Sun Jan 21 05:52:47 1990 Doug Lea (dl at g.oswego.edu)
-
- bins are now own struct for, sanity.
-
- new victim search strategy: scan up and consolidate.
- Both faster and less fragmentation.
-
- refined when to scan bins for consolidation, via consollink, etc.
-
- realloc: always try to expand chunk, avoiding some fragmentation.
-
- changed a few inlines into macros
-
- hardwired SBRK_UNIT to 4096 for uniformity across systems
-
- Tue Mar 20 14:18:23 1990 Doug Lea (dl at g.oswego.edu)
-
- calloc and cfree now correctly parameterized.
-
- Sun Apr 1 10:00:48 1990 Doug Lea (dl at g.oswego.edu)
-
- added memalign and valloc.
-
- Sun Jun 24 05:46:48 1990 Doug Lea (dl at g.oswego.edu)
-
- #include gepagesize.h only ifndef sun
- cache pagesize after first call
-
- Wed Jul 25 08:35:19 1990 Doug Lea (dl at g.oswego.edu)
-
- No longer rely on a `designated victim':
-
- 1. It sometimes caused splits of large chunks
- when smaller ones would do, leading to
- bad worst-case fragmentation.
-
- 2. Scanning through the av array fast anyway,
- so the overhead isn't worth it.
-
- To compensate, several other minor changes:
-
- 1. Unusable chunks are checked for consolidation during
- searches inside bins, better distributing chunks
- across bins.
-
- 2. Chunks are returned when found in malloc_find_space,
- rather than finishing cleaning everything up, to
- avoid wasted iterations due to (1).
-*/
-
-/*
- A version of malloc/free/realloc tuned for C++ applications.
-
- Here's what you probably want to know first:
-
- In various tests, this appears to be about as fast as,
- and usually substantially less memory-wasteful than BSD/GNUemacs malloc.
-
- Generally, it is slower (by perhaps 20%) than bsd-style malloc
- only when bsd malloc would waste a great deal of space in
- fragmented blocks, which this malloc recovers; or when, by
- chance or design, nearly all requests are near the bsd malloc
- power-of-2 allocation bin boundaries, and as many chunks are
- used as are allocated.
-
- It uses more space than bsd malloc only when, again by chance
- or design, only bsdmalloc bin-sized requests are malloced, or when
- little dynamic space is malloced, since this malloc may grab larger
- chunks from the system at a time than bsd.
-
- In other words, this malloc seems generally superior to bsd
- except perhaps for programs that are specially tuned to
- deal with bsdmalloc's characteristics. But even here, the
- performance differences are slight.
-
-
- This malloc, like any other, is a compromised design.
-
-
- Chunks of memory are maintained using a `boundary tag' method as
- described in e.g., Knuth or Standish. This means that the size of
- the chunk is stored both in the front of the chunk and at the end.
- This makes consolidating fragmented chunks into bigger chunks very fast.
- The size field is also used to hold bits representing whether a
- chunk is free or in use.
-
- Malloced chunks have space overhead of 8 bytes: The preceding
- and trailing size fields. When they are freed, the list pointer
- fields are also needed.
-
- Available chunks are kept in doubly linked lists. The lists are
- maintained in an array of bins using a power-of-two method, except
- that instead of 32 bins (one for each 1 << i), there are 128: each
- power of two is split in quarters. The use of very fine bin sizes
- closely approximates the use of one bin per actually used size,
- without necessitating the overhead of locating such bins. It is
- especially desirable in common C++ applications where large numbers
- of identically-sized blocks are malloced/freed in some dynamic
- manner, and then later are all freed. The finer bin sizes make
- finding blocks fast, with little wasted overallocation. The
- consolidation methods ensure that once the collection of blocks is
- no longer useful, fragments are gathered into bigger chunks awaiting new
- roles.
-
- The bins av[i] serve as heads of the lists. Bins contain a dummy
- header for the chunk lists, and a `dirty' field used to indicate
- whether the list may need to be scanned for consolidation.
-
- On allocation, the bin corresponding to the request size is
- scanned, and if there is a chunk with size >= requested, it
- is split, if too big, and used. Chunks on the list which are
- too small are examined for consolidation during this traversal.
-
- If no chunk exists in the list bigger bins are scanned in search of
- a victim.
-
- If no victim can be found, then smaller bins are examined for
- consolidation in order to construct a victim.
-
- Finally, if consolidation fails to come up with a usable chunk,
- more space is obtained from the system.
-
- After a split, the remainder is placed on
- the back of the appropriate bin list. (All freed chunks are placed
- on fronts of lists. All remaindered or consolidated chunks are
- placed on the rear. Correspondingly, searching within a bin
- starts at the front, but finding victims is from the back. All
- of this approximates the effect of having 2 kinds of lists per
- bin: returned chunks vs unallocated chunks, but without the overhead
- of maintaining 2 lists.)
-
- Deallocation (free) consists only of placing the chunk on
- a list.
-
- Reallocation proceeds in the usual way. If a chunk can be extended,
- it is, else a malloc-copy-free sequence is taken.
-
- 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. Overreliance
- on memalign is a sure way to fragment space.
-
-
- Some other implementation matters:
-
- 8 byte alignment is currently hardwired into the design. Calling
- memalign will return a chunk that is both 8-byte aligned, and
- meets the requested alignment.
-
- The basic overhead of a used chunk is 8 bytes: 4 at the front and
- 4 at the end.
-
- When a chunk is free, 8 additional bytes are needed for free list
- pointers. Thus, the minimum allocatable size is 16 bytes.
-
- The existence of front and back overhead permits some reasonably
- effective fence-bashing checks: The front and back fields must
- be identical. This is checked only within free() and realloc().
- The checks are fast enough to be made non-optional.
-
- The overwriting of parts of freed memory with the freelist pointers
- can also be very effective (albeit in an annoying way) in helping
- users track down dangling pointers.
-
- User overwriting of freed space will often result in crashes
- within malloc or free.
-
- These routines are also tuned to C++ in that free(0) is a noop and
- a failed malloc automatically calls (*new_handler)().
-
- malloc(0) returns a pointer to something of the minimum allocatable size.
-
- Additional memory is gathered from the system (via sbrk) 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.
-
- This malloc is NOT designed to work in multiprocessing 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.
-
- VERY heavy use of inlines is made, for clarity. If this malloc
- is ported via a compiler without inlining capabilities, all
- inlines should be transformed into macros -- making them non-inline
- makes malloc at least twice as slow.
-
-
-*/
-
-
-/* preliminaries */
-
-#ifdef __cplusplus
-#include <stdio.h>
-#else
-#include "//usr/include/stdio.h" /* needed for error reporting */
-#endif
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#ifdef USG
-extern void* memset(void*, int, int);
-extern void* memcpy(void*, const void*, int);
-inline void bzero(void* s, int l) { memset(s, 0, l); }
-#else
-extern void bzero(void*, unsigned int);
-#endif
-
-extern void bcopy(void*, void*, unsigned int);
-
-extern void* sbrk(unsigned int);
-
-
-#ifdef __GNUC__
-extern volatile void abort();
-#else
-extern void abort();
-#endif
-
-#ifdef __cplusplus
-}; /* end of extern "C" */
-#endif
-
-
-/* A good multiple to call sbrk with */
-
-#define SBRK_UNIT 4096
-
-
-
-/* how to die on detected error */
-
-#ifdef __GNUC__
-static volatile void malloc_user_error()
-#else
-static void malloc_user_error()
-#endif
-{
- fputs("malloc/free/realloc: clobbered space detected\n", stderr); abort();
-}
-
-
-
-/* Basic overhead for each malloc'ed chunk */
-
-
-struct malloc_chunk
-{
- unsigned int size; /* Size in bytes, including overhead. */
- /* Or'ed with INUSE if in use. */
-
- struct malloc_chunk* fd; /* double links -- used only if free. */
- struct malloc_chunk* bk;
-
-};
-
-typedef struct malloc_chunk* mchunkptr;
-
-struct malloc_bin
-{
- struct malloc_chunk hd; /* dummy list header */
- unsigned int dirty; /* True if maybe consolidatable */
- /* Wasting a word here makes */
- /* sizeof(bin) a power of 2, */
- /* which makes size2bin() faster */
-};
-
-typedef struct malloc_bin* mbinptr;
-
-
-/* sizes, alignments */
-
-
-#define SIZE_SZ (sizeof(unsigned int))
-#define MALLOC_MIN_OVERHEAD (SIZE_SZ + SIZE_SZ)
-#define MALLOC_ALIGN_MASK (MALLOC_MIN_OVERHEAD - 1)
-
-#define MINSIZE (sizeof(struct malloc_chunk) + SIZE_SZ) /* MUST == 16! */
-
-
-/* pad request bytes into a usable size */
-
-static inline unsigned int request2size(unsigned int request)
-{
- return (request == 0) ? MINSIZE :
- ((request + MALLOC_MIN_OVERHEAD + MALLOC_ALIGN_MASK)
- & ~(MALLOC_ALIGN_MASK));
-}
-
-
-static inline int aligned_OK(void* m)
-{
- return ((unsigned int)(m) & (MALLOC_ALIGN_MASK)) == 0;
-}
-
-
-/* size field or'd with INUSE when in use */
-#define INUSE 0x1
-
-
-
-/* the bins, initialized to have null double linked lists */
-
-#define MAXBIN 120 /* 1 more than needed for 32 bit addresses */
-
-#define FIRSTBIN (&(av[0]))
-
-static struct malloc_bin av[MAXBIN] =
-{
- { { 0, &(av[0].hd), &(av[0].hd) }, 0 },
- { { 0, &(av[1].hd), &(av[1].hd) }, 0 },
- { { 0, &(av[2].hd), &(av[2].hd) }, 0 },
- { { 0, &(av[3].hd), &(av[3].hd) }, 0 },
- { { 0, &(av[4].hd), &(av[4].hd) }, 0 },
- { { 0, &(av[5].hd), &(av[5].hd) }, 0 },
- { { 0, &(av[6].hd), &(av[6].hd) }, 0 },
- { { 0, &(av[7].hd), &(av[7].hd) }, 0 },
- { { 0, &(av[8].hd), &(av[8].hd) }, 0 },
- { { 0, &(av[9].hd), &(av[9].hd) }, 0 },
-
- { { 0, &(av[10].hd), &(av[10].hd) }, 0 },
- { { 0, &(av[11].hd), &(av[11].hd) }, 0 },
- { { 0, &(av[12].hd), &(av[12].hd) }, 0 },
- { { 0, &(av[13].hd), &(av[13].hd) }, 0 },
- { { 0, &(av[14].hd), &(av[14].hd) }, 0 },
- { { 0, &(av[15].hd), &(av[15].hd) }, 0 },
- { { 0, &(av[16].hd), &(av[16].hd) }, 0 },
- { { 0, &(av[17].hd), &(av[17].hd) }, 0 },
- { { 0, &(av[18].hd), &(av[18].hd) }, 0 },
- { { 0, &(av[19].hd), &(av[19].hd) }, 0 },
-
- { { 0, &(av[20].hd), &(av[20].hd) }, 0 },
- { { 0, &(av[21].hd), &(av[21].hd) }, 0 },
- { { 0, &(av[22].hd), &(av[22].hd) }, 0 },
- { { 0, &(av[23].hd), &(av[23].hd) }, 0 },
- { { 0, &(av[24].hd), &(av[24].hd) }, 0 },
- { { 0, &(av[25].hd), &(av[25].hd) }, 0 },
- { { 0, &(av[26].hd), &(av[26].hd) }, 0 },
- { { 0, &(av[27].hd), &(av[27].hd) }, 0 },
- { { 0, &(av[28].hd), &(av[28].hd) }, 0 },
- { { 0, &(av[29].hd), &(av[29].hd) }, 0 },
-
- { { 0, &(av[30].hd), &(av[30].hd) }, 0 },
- { { 0, &(av[31].hd), &(av[31].hd) }, 0 },
- { { 0, &(av[32].hd), &(av[32].hd) }, 0 },
- { { 0, &(av[33].hd), &(av[33].hd) }, 0 },
- { { 0, &(av[34].hd), &(av[34].hd) }, 0 },
- { { 0, &(av[35].hd), &(av[35].hd) }, 0 },
- { { 0, &(av[36].hd), &(av[36].hd) }, 0 },
- { { 0, &(av[37].hd), &(av[37].hd) }, 0 },
- { { 0, &(av[38].hd), &(av[38].hd) }, 0 },
- { { 0, &(av[39].hd), &(av[39].hd) }, 0 },
-
- { { 0, &(av[40].hd), &(av[40].hd) }, 0 },
- { { 0, &(av[41].hd), &(av[41].hd) }, 0 },
- { { 0, &(av[42].hd), &(av[42].hd) }, 0 },
- { { 0, &(av[43].hd), &(av[43].hd) }, 0 },
- { { 0, &(av[44].hd), &(av[44].hd) }, 0 },
- { { 0, &(av[45].hd), &(av[45].hd) }, 0 },
- { { 0, &(av[46].hd), &(av[46].hd) }, 0 },
- { { 0, &(av[47].hd), &(av[47].hd) }, 0 },
- { { 0, &(av[48].hd), &(av[48].hd) }, 0 },
- { { 0, &(av[49].hd), &(av[49].hd) }, 0 },
-
- { { 0, &(av[50].hd), &(av[50].hd) }, 0 },
- { { 0, &(av[51].hd), &(av[51].hd) }, 0 },
- { { 0, &(av[52].hd), &(av[52].hd) }, 0 },
- { { 0, &(av[53].hd), &(av[53].hd) }, 0 },
- { { 0, &(av[54].hd), &(av[54].hd) }, 0 },
- { { 0, &(av[55].hd), &(av[55].hd) }, 0 },
- { { 0, &(av[56].hd), &(av[56].hd) }, 0 },
- { { 0, &(av[57].hd), &(av[57].hd) }, 0 },
- { { 0, &(av[58].hd), &(av[58].hd) }, 0 },
- { { 0, &(av[59].hd), &(av[59].hd) }, 0 },
-
- { { 0, &(av[60].hd), &(av[60].hd) }, 0 },
- { { 0, &(av[61].hd), &(av[61].hd) }, 0 },
- { { 0, &(av[62].hd), &(av[62].hd) }, 0 },
- { { 0, &(av[63].hd), &(av[63].hd) }, 0 },
- { { 0, &(av[64].hd), &(av[64].hd) }, 0 },
- { { 0, &(av[65].hd), &(av[65].hd) }, 0 },
- { { 0, &(av[66].hd), &(av[66].hd) }, 0 },
- { { 0, &(av[67].hd), &(av[67].hd) }, 0 },
- { { 0, &(av[68].hd), &(av[68].hd) }, 0 },
- { { 0, &(av[69].hd), &(av[69].hd) }, 0 },
-
- { { 0, &(av[70].hd), &(av[70].hd) }, 0 },
- { { 0, &(av[71].hd), &(av[71].hd) }, 0 },
- { { 0, &(av[72].hd), &(av[72].hd) }, 0 },
- { { 0, &(av[73].hd), &(av[73].hd) }, 0 },
- { { 0, &(av[74].hd), &(av[74].hd) }, 0 },
- { { 0, &(av[75].hd), &(av[75].hd) }, 0 },
- { { 0, &(av[76].hd), &(av[76].hd) }, 0 },
- { { 0, &(av[77].hd), &(av[77].hd) }, 0 },
- { { 0, &(av[78].hd), &(av[78].hd) }, 0 },
- { { 0, &(av[79].hd), &(av[79].hd) }, 0 },
-
- { { 0, &(av[80].hd), &(av[80].hd) }, 0 },
- { { 0, &(av[81].hd), &(av[81].hd) }, 0 },
- { { 0, &(av[82].hd), &(av[82].hd) }, 0 },
- { { 0, &(av[83].hd), &(av[83].hd) }, 0 },
- { { 0, &(av[84].hd), &(av[84].hd) }, 0 },
- { { 0, &(av[85].hd), &(av[85].hd) }, 0 },
- { { 0, &(av[86].hd), &(av[86].hd) }, 0 },
- { { 0, &(av[87].hd), &(av[87].hd) }, 0 },
- { { 0, &(av[88].hd), &(av[88].hd) }, 0 },
- { { 0, &(av[89].hd), &(av[89].hd) }, 0 },
-
- { { 0, &(av[90].hd), &(av[90].hd) }, 0 },
- { { 0, &(av[91].hd), &(av[91].hd) }, 0 },
- { { 0, &(av[92].hd), &(av[92].hd) }, 0 },
- { { 0, &(av[93].hd), &(av[93].hd) }, 0 },
- { { 0, &(av[94].hd), &(av[94].hd) }, 0 },
- { { 0, &(av[95].hd), &(av[95].hd) }, 0 },
- { { 0, &(av[96].hd), &(av[96].hd) }, 0 },
- { { 0, &(av[97].hd), &(av[97].hd) }, 0 },
- { { 0, &(av[98].hd), &(av[98].hd) }, 0 },
- { { 0, &(av[99].hd), &(av[99].hd) }, 0 },
-
- { { 0, &(av[100].hd), &(av[100].hd) }, 0 },
- { { 0, &(av[101].hd), &(av[101].hd) }, 0 },
- { { 0, &(av[102].hd), &(av[102].hd) }, 0 },
- { { 0, &(av[103].hd), &(av[103].hd) }, 0 },
- { { 0, &(av[104].hd), &(av[104].hd) }, 0 },
- { { 0, &(av[105].hd), &(av[105].hd) }, 0 },
- { { 0, &(av[106].hd), &(av[106].hd) }, 0 },
- { { 0, &(av[107].hd), &(av[107].hd) }, 0 },
- { { 0, &(av[108].hd), &(av[108].hd) }, 0 },
- { { 0, &(av[109].hd), &(av[109].hd) }, 0 },
-
- { { 0, &(av[110].hd), &(av[110].hd) }, 0 },
- { { 0, &(av[111].hd), &(av[111].hd) }, 0 },
- { { 0, &(av[112].hd), &(av[112].hd) }, 0 },
- { { 0, &(av[113].hd), &(av[113].hd) }, 0 },
- { { 0, &(av[114].hd), &(av[114].hd) }, 0 },
- { { 0, &(av[115].hd), &(av[115].hd) }, 0 },
- { { 0, &(av[116].hd), &(av[116].hd) }, 0 },
- { { 0, &(av[117].hd), &(av[117].hd) }, 0 },
- { { 0, &(av[118].hd), &(av[118].hd) }, 0 },
- { { 0, &(av[119].hd), &(av[119].hd) }, 0 }
-};
-
-/*
- indexing into bins
-*/
-
-static inline mbinptr size2bin(unsigned int sz)
-{
- mbinptr b = av;
- while (sz >= (MINSIZE * 2)) { b += 4; sz >>= 1; } /* find power of 2 */
- b += (sz - MINSIZE) >> 2; /* find quadrant */
- return b;
-}
-
-
-
-/* counts maintained if MALLOC_STATS defined */
-
-#ifdef MALLOC_STATS
-
-static unsigned int sbrked_mem;
-static unsigned int requested_mem;
-static unsigned int malloced_mem;
-static unsigned int freed_mem;
-static unsigned int max_used_mem;
-
-static unsigned int n_sbrks;
-static unsigned int n_mallocs;
-static unsigned int n_frees;
-static unsigned int n_reallocs;
-static unsigned int n_reallocs_with_copy;
-static unsigned int n_avail;
-static unsigned int max_inuse;
-
-static unsigned int n_malloc_chunks;
-static unsigned int n_malloc_bins;
-
-static unsigned int n_split;
-static unsigned int n_consol;
-
-
-static void do_malloc_stats(const mchunkptr p)
-{
- ++n_mallocs;
- if ((n_mallocs-n_frees) > max_inuse)
- max_inuse = n_mallocs - n_frees;
- malloced_mem += (p->size & ~(INUSE));
- if (malloced_mem - freed_mem > max_used_mem)
- max_used_mem = malloced_mem - freed_mem;
-}
-
-static void do_free_stats(const mchunkptr p)
-{
- ++n_frees;
- freed_mem += (p->size & ~(INUSE));
-}
-
-#endif
-
-
-
-/* Utilities needed below for memalign */
-/* This is redundant with libg++ support, but not if used stand-alone */
-
-static unsigned int gcd(unsigned int a, unsigned int b)
-{
- unsigned int 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;
- }
- }
-}
-
-static inline unsigned int lcm(unsigned int x, unsigned int y)
-{
- return x / gcd(x, y) * y;
-}
-
-
-
-/* maintaining INUSE via size field */
-
-
-#define inuse(p) ((p)->size & INUSE)
-#define set_inuse(p) ((p)->size |= INUSE)
-#define clear_inuse(b) ((p)->size &= ~INUSE)
-
-
-/* operations on malloc_chunk addresses */
-
-
-/* return ptr to next physical malloc_chunk */
-
-#define next_chunk(p) ((mchunkptr)((char*)(p) + (p)->size))
-
-/* return ptr to previous physical malloc_chunk */
-
-#define prev_chunk(p) ((mchunkptr)((char*)(p)-((((int*)(p))[-1]) & ~(INUSE))))
-
-/* place size at front and back of chunk */
-
-
-static inline void set_size(mchunkptr p, unsigned int sz)
-{
- p->size = *((int*)((char*)(p) + sz - SIZE_SZ)) = sz;
-}
-
-
-
-
-/* conversion from malloc headers to user pointers, and back */
-
-static inline void* chunk2mem(mchunkptr p)
-{
- set_inuse(p);
- return (void*)((char*)(p) + SIZE_SZ);
-}
-
-static inline mchunkptr mem2chunk(void* mem)
-{
- mchunkptr p = (mchunkptr)((char*)(mem) - SIZE_SZ);
-
- /* a quick sanity check */
- unsigned int sz = p->size & ~(INUSE);
- if (p->size == sz || sz != *((int*)((char*)(p) + sz - SIZE_SZ)))
- malloc_user_error();
-
- p->size = sz; /* clears INUSE */
- return p;
-}
-
-
-
-/* maintaining bins & pointers */
-
-
-/* maximum bin actually used */
-
-static mbinptr malloc_maxbin = FIRSTBIN;
-
-
-/* operations on lists inside bins */
-
-
-/* take a chunk off a list */
-
-static inline void unlink(mchunkptr p)
-{
- mchunkptr b = p->bk;
- mchunkptr f = p->fd;
-
- f->bk = b; b->fd = f;
-
- UPDATE_STATS (--n_avail);
-}
-
-
-
-/* split a chunk and place on the back of a list */
-
-static inline void split(mchunkptr p, unsigned int offset)
-{
- unsigned int room = p->size - offset;
- if (room >= MINSIZE)
- {
- mbinptr bn = size2bin(room); /* new bin */
- mchunkptr h = &(bn->hd); /* its head */
- mchunkptr b = h->bk; /* old back element */
- mchunkptr t = (mchunkptr)((char*)(p) + offset); /* remaindered chunk */
-
- /* set size */
- t->size = *((int*)((char*)(t) + room - SIZE_SZ)) = room;
-
- /* link up */
- t->bk = b; t->fd = h; h->bk = b->fd = t;
-
- /* adjust maxbin (h == b means was empty) */
- if (h == b && bn > malloc_maxbin) malloc_maxbin = bn;
-
- /* adjust size of chunk to be returned */
- p->size = *((int*)((char*)(p) + offset - SIZE_SZ)) = offset;
-
- UPDATE_STATS ((++n_split, ++n_avail));
- }
-}
-
-
-
-/* place a consolidated chunk on the back of a list */
-/* like above, except no split */
-
-static inline void consollink(mchunkptr p)
-{
- mbinptr bn = size2bin(p->size);
- mchunkptr h = &(bn->hd);
- mchunkptr b = h->bk;
-
- p->bk = b; p->fd = h; h->bk = b->fd = p;
-
- if (h == b && bn > malloc_maxbin) malloc_maxbin = bn;
-
- UPDATE_STATS(++n_avail);
-}
-
-
-/* place a freed chunk on the front of a list */
-
-static inline void frontlink(mchunkptr p)
-{
- mbinptr bn = size2bin(p->size);
- mchunkptr h = &(bn->hd);
- mchunkptr f = h->fd;
-
- p->bk = h; p->fd = f; f->bk = h->fd = p;
-
- if (h == f && bn > malloc_maxbin) malloc_maxbin = bn;
-
- bn->dirty = 1;
-
- UPDATE_STATS(++n_avail);
-}
-
-
-
-/* Dealing with sbrk */
-
-
-/* To link consecutive sbrk regions when possible */
-
-static int* last_sbrk_end;
-
-
-/* who to call when sbrk returns failure */
-
-#ifndef NO_NEW_HANDLER
-typedef volatile void (*vfp)();
-#ifdef __cplusplus
-extern "C" vfp __new_handler;
-#else
-extern vfp __new_handler;
-#endif
-#endif
-
-static mchunkptr malloc_from_sys(unsigned nb)
-{
- mchunkptr p;
- unsigned int sbrk_size;
- int* ip;
-
- /* Minimally, we need to pad with enough space */
- /* to place dummy size/use fields to ends if needed */
-
- sbrk_size = ((nb + SBRK_UNIT - 1 + SIZE_SZ + SIZE_SZ)
- / SBRK_UNIT) * SBRK_UNIT;
-
- ip = (int*)(sbrk(sbrk_size));
- if ((char*)ip == (char*)(-1)) /* sbrk returns -1 on failure */
- {
-#ifndef NO_NEW_HANDLER
- (*__new_handler) ();
-#endif
- return 0;
- }
-
- UPDATE_STATS ((++n_sbrks, sbrked_mem += sbrk_size));
-
-
- if (last_sbrk_end != &ip[-1])
- {
- /* It's either first time through or someone else called sbrk. */
- /* Arrange end-markers at front & back */
-
- /* Shouldn't be necessary, but better to be safe */
- while (!aligned_OK(ip)) { ++ip; sbrk_size -= SIZE_SZ; }
-
-
- /* Mark the front as in use to prevent merging. */
- /* Note we can get away with only 1 word, not MINSIZE overhead here */
-
- *ip++ = SIZE_SZ | INUSE;
-
- p = (mchunkptr)ip;
- set_size(p,sbrk_size - (SIZE_SZ + SIZE_SZ));
-
- }
- else
- {
- mchunkptr l;
-
- /* We can safely make the header start at end of prev sbrked chunk. */
- /* We will still have space left at the end from a previous call */
- /* to place the end marker, below */
-
- p = (mchunkptr)(last_sbrk_end);
- set_size(p, sbrk_size);
-
-
- /* Even better, maybe we can merge with last fragment: */
-
- l = prev_chunk(p);
- if (!inuse(l))
- {
- unlink(l);
- set_size(l, p->size + l->size);
- p = l;
- }
-
- }
-
- /* mark the end of sbrked space as in use to prevent merging */
-
- last_sbrk_end = (int*)((char*)p + p->size);
- *last_sbrk_end = SIZE_SZ | INUSE;
-
- UPDATE_STATS((++n_avail, ++n_malloc_chunks));
-
- /* make it safe to unlink in malloc */
- UPDATE_STATS(++n_avail);
- p->fd = p->bk = p;
-
- return p;
-}
-
-
-
-/* Consolidate dirty bins. */
-/* Stop if found a chunk big enough to satisfy current malloc request */
-
-/* (It requires much less bookkeeping to consolidate entire bins */
-/* at once than to keep records of which chunks might be */
-/* consolidatable. So long as the lists are short, which we */
-/* try to ensure via small bin ranges, there is little wasted effort.) */
-
-static mchunkptr malloc_find_space(unsigned int nb)
-{
- mbinptr b;
-
- /* first, re-adjust max used bin */
-
- while (malloc_maxbin >= FIRSTBIN &&
- malloc_maxbin->hd.bk == &(malloc_maxbin->hd))
- {
- malloc_maxbin->dirty = 0;
- --malloc_maxbin;
- }
-
- for (b = malloc_maxbin; b >= FIRSTBIN; --b)
- {
- UPDATE_STATS(++n_malloc_bins);
-
- if (b->dirty)
- {
- mchunkptr h = &(b->hd); /* head of list */
- mchunkptr p = h->fd; /* chunk traverser */
-
- while (p != h)
- {
- mchunkptr nextp = p->fd; /* save, in case of relinks */
- int consolidated = 0; /* only unlink/relink if consolidated */
-
- mchunkptr t;
-
- UPDATE_STATS(++n_malloc_chunks);
-
- while (!inuse(t = prev_chunk(p))) /* consolidate backward */
- {
- if (!consolidated) { consolidated = 1; unlink(p); }
- if (t == nextp) nextp = t->fd;
- unlink(t);
- set_size(t, t->size + p->size);
- p = t;
- UPDATE_STATS (++n_consol);
- }
-
- while (!inuse(t = next_chunk(p))) /* consolidate forward */
- {
- if (!consolidated) { consolidated = 1; unlink(p); }
- if (t == nextp) nextp = t->fd;
- unlink(t);
- set_size(p, p->size + t->size);
- UPDATE_STATS (++n_consol);
- }
-
- if (consolidated)
- {
- if (p->size >= nb)
- {
- /* make it safe to unlink in malloc */
- UPDATE_STATS(++n_avail);
- p->fd = p->bk = p;
- return p;
- }
- else
- consollink(p);
- }
-
- p = nextp;
-
- }
-
- b->dirty = 0;
-
- }
- }
-
- /* nothing available - sbrk some more */
-
- return malloc_from_sys(nb);
-}
-
-
-
-/* Finally, the user-level functions */
-
-void* malloc(unsigned int bytes)
-{
- unsigned int nb = request2size(bytes); /* padded request size */
- mbinptr b = size2bin(nb); /* corresponding bin */
- mchunkptr hd = &(b->hd); /* head of its list */
- mchunkptr p = hd->fd; /* chunk traverser */
-
- UPDATE_STATS((requested_mem+=bytes, ++n_malloc_bins));
-
- /* Try a (near) exact match in own bin */
- /* clean out unusable but consolidatable chunks in bin while traversing */
-
- while (p != hd)
- {
- UPDATE_STATS(++n_malloc_chunks);
- if (p->size >= nb)
- goto found;
- else /* try to consolidate; same code as malloc_find_space */
- {
- mchunkptr nextp = p->fd; /* save, in case of relinks */
- int consolidated = 0; /* only unlink/relink if consolidated */
-
- mchunkptr t;
-
- while (!inuse(t = prev_chunk(p))) /* consolidate backward */
- {
- if (!consolidated) { consolidated = 1; unlink(p); }
- if (t == nextp) nextp = t->fd;
- unlink(t);
- set_size(t, t->size + p->size);
- p = t;
- UPDATE_STATS (++n_consol);
- }
-
- while (!inuse(t = next_chunk(p))) /* consolidate forward */
- {
- if (!consolidated) { consolidated = 1; unlink(p); }
- if (t == nextp) nextp = t->fd;
- unlink(t);
- set_size(p, p->size + t->size);
- UPDATE_STATS (++n_consol);
- }
-
- if (consolidated)
- {
- if (p->size >= nb)
- {
- /* make it safe to unlink again below */
- UPDATE_STATS(++n_avail);
- p->fd = p->bk = p;
- goto found;
- }
- else
- consollink(p);
- }
-
- p = nextp;
-
- }
- }
-
- b->dirty = 0; /* true if got here */
-
- /* Scan bigger bins for a victim */
-
- while (++b <= malloc_maxbin)
- {
- UPDATE_STATS(++n_malloc_bins);
- if ((p = b->hd.bk) != &(b->hd)) /* no need to check size */
- goto found;
- }
-
- /* Consolidate or sbrk */
-
- p = malloc_find_space(nb);
-
- if (p == 0) return 0; /* allocation failure */
-
- found: /* Use what we found */
-
- unlink(p);
- split(p, nb);
- UPDATE_STATS(do_malloc_stats(p));
- return chunk2mem(p);
-}
-
-
-
-
-void free(void* mem)
-{
- if (mem != 0)
- {
- mchunkptr p = mem2chunk(mem);
- UPDATE_STATS(do_free_stats(p));
- frontlink(p);
- }
-}
-
-
-void* calloc(unsigned int n, unsigned int elem_size)
-{
- unsigned int sz = n * elem_size;
- void* p = malloc(sz);
- bzero(p, sz);
- return p;
-};
-
-/* This is here for compatibility with older systems */
-void cfree(void *mem)
-{
- free(mem);
-}
-
-
-unsigned int malloc_usable_size(void* mem)
-{
- if (mem == 0)
- return 0;
- else
- {
- mchunkptr p = (mchunkptr)((char*)(mem) - SIZE_SZ);
- unsigned int sz = p->size & ~(INUSE);
- if (p->size == sz || sz != *((int*)((char*)(p) + sz - SIZE_SZ)))
- return 0;
- else
- return sz - MALLOC_MIN_OVERHEAD;
- }
-}
-
-
-
-void* realloc(void* mem, unsigned int bytes)
-{
- if (mem == 0)
- return malloc(bytes);
- else
- {
- unsigned int nb = request2size(bytes);
- mchunkptr p = mem2chunk(mem);
- unsigned int oldsize = p->size;
- int room;
- mchunkptr nxt;
-
- UPDATE_STATS((++n_reallocs, requested_mem += bytes-oldsize));
-
- /* try to expand (even if already big enough), to clean up chunk */
-
- while (!inuse(nxt = next_chunk(p)))
- {
- UPDATE_STATS ((malloced_mem += nxt->size, ++n_consol));
- unlink(nxt);
- set_size(p, p->size + nxt->size);
- }
-
- room = p->size - nb;
- if (room >= 0)
- {
- split(p, nb);
- UPDATE_STATS(malloced_mem -= room);
- return chunk2mem(p);
- }
- else /* do the obvious */
- {
- void* newmem;
- set_inuse(p); /* don't let malloc consolidate us yet! */
- newmem = malloc(nb);
- bcopy(mem, newmem, oldsize - SIZE_SZ);
- free(mem);
- UPDATE_STATS(++n_reallocs_with_copy);
- return newmem;
- }
- }
-}
-
-
-
-/* return a pointer to space with at least the alignment requested */
-
-void* memalign(unsigned int alignment, unsigned int bytes)
-{
- mchunkptr p;
- unsigned int nb = request2size(bytes);
-
- /* find an alignment that both we and the user can live with: */
- /* least common multiple guarantees mutual happiness */
- unsigned int align = lcm(alignment, MALLOC_MIN_OVERHEAD);
- unsigned int mask = align - 1;
-
- /* call malloc with worst case padding to hit alignment; */
- /* we will give back extra */
-
- unsigned int req = nb + align + MINSIZE;
- void* m = malloc(req);
-
- if (m == 0) return m;
-
- p = mem2chunk(m);
-
- /* keep statistics on track */
-
- UPDATE_STATS(--n_mallocs);
- UPDATE_STATS(malloced_mem -= p->size);
- UPDATE_STATS(requested_mem -= req);
- UPDATE_STATS(requested_mem += bytes);
-
- if (((int)(m) & (mask)) != 0) /* misaligned */
- {
-
- /* find an aligned spot inside chunk */
-
- mchunkptr ap = (mchunkptr)(( ((int)(m) + mask) & -align) - SIZE_SZ);
-
- unsigned int gap = (unsigned int)(ap) - (unsigned int)(p);
- unsigned int room;
-
- /* we need to give back leading space in a chunk of at least MINSIZE */
-
- if (gap < MINSIZE)
- {
- /* This works since align >= MINSIZE */
- /* and we've malloc'd enough total room */
-
- ap = (mchunkptr)( (int)(ap) + align );
- gap += align;
- }
-
- if (gap + nb > p->size) /* can't happen unless chunk sizes corrupted */
- malloc_user_error();
-
- room = p->size - gap;
-
- /* give back leader */
- set_size(p, gap);
- consollink(p);
-
- /* use the rest */
- p = ap;
- set_size(p, room);
- }
-
- /* also give back spare room at the end */
-
- split(p, nb);
- UPDATE_STATS(do_malloc_stats(p));
- return chunk2mem(p);
-
-}
-
-#ifndef sun
-#include <getpagesize.h>
-#endif
-
-static unsigned int malloc_pagesize = 0;
-
-void* valloc(unsigned int bytes)
-{
- if (malloc_pagesize == 0) malloc_pagesize = getpagesize();
- return memalign (malloc_pagesize, bytes);
-}
-
-
-void malloc_stats()
-{
-#ifndef MALLOC_STATS
-}
-#else
- int i;
- mchunkptr p;
- double nm = (double)(n_mallocs + n_reallocs);
-
- fprintf(stderr, "\nmalloc statistics\n\n");
-
- if (n_mallocs != 0)
- fprintf(stderr, "requests = %10u total size = %10u\tave = %10u\n",
- n_mallocs, requested_mem, requested_mem/n_mallocs);
-
- if (n_mallocs != 0)
- fprintf(stderr, "mallocs = %10u total size = %10u\tave = %10u\n",
- n_mallocs, malloced_mem, malloced_mem/n_mallocs);
-
- if (n_frees != 0)
- fprintf(stderr, "frees = %10u total size = %10u\tave = %10u\n",
- n_frees, freed_mem, freed_mem/n_frees);
-
- if (n_mallocs-n_frees != 0)
- fprintf(stderr, "in use = %10u total size = %10u\tave = %10u\n",
- n_mallocs-n_frees, malloced_mem-freed_mem,
- (malloced_mem-freed_mem) / (n_mallocs-n_frees));
-
- if (max_inuse != 0)
- fprintf(stderr, "max in use= %10u total size = %10u\tave = %10u\n",
- max_inuse, max_used_mem, max_used_mem / max_inuse);
-
- if (n_avail != 0)
- fprintf(stderr, "available = %10u total size = %10u\tave = %10u\n",
- n_avail, sbrked_mem - (malloced_mem-freed_mem),
- (sbrked_mem - (malloced_mem-freed_mem)) / n_avail);
-
- if (n_sbrks != 0)
- fprintf(stderr, "sbrks = %10u total size = %10u\tave = %10u\n\n",
- n_sbrks, sbrked_mem, sbrked_mem/ n_sbrks);
-
- if (n_reallocs != 0)
- fprintf(stderr, "reallocs = %10u with copy = %10u\n\n",
- n_reallocs, n_reallocs_with_copy);
-
-
- if (nm != 0)
- {
- fprintf(stderr, "chunks scanned per malloc = %6.3f\n",
- n_malloc_chunks / nm);
- fprintf(stderr, "bins scanned per malloc = %6.3f\n",
- n_malloc_bins / nm);
- fprintf(stderr, "splits per malloc = %6.3f\n",
- n_split / nm);
- fprintf(stderr, "consolidations per malloc = %6.3f\n",
- n_consol / nm);
- }
-
- fprintf(stderr, "\nfree chunks:\n");
- for (i = 0; i < MAXBIN; ++i)
- {
- p = av[i].hd.fd;
- if (p != &(av[i].hd))
- {
- unsigned int count = 1;
- unsigned int sz = p->size;
- for (p = p->fd; p != &(av[i].hd); p = p->fd)
- {
- if (p->size == sz)
- ++count;
- else
- {
- fprintf(stderr, "\tsize = %10u count = %5u\n", sz, count);
- count = 1;
- sz = p->size;
- }
- }
-
- fprintf(stderr, "\tsize = %10u count = %5u\n", sz, count);
-
- }
- }
-}
-#endif /* MALLOC_STATS */
-
-#endif /* NO_LIBGXX_MALLOC */
diff --git a/gnu/lib/libg++/libg++/max.cc b/gnu/lib/libg++/libg++/max.cc
deleted file mode 100644
index cb42168a438..00000000000
--- a/gnu/lib/libg++/libg++/max.cc
+++ /dev/null
@@ -1,4 +0,0 @@
-#ifdef __GNUG__
-#pragma implementation
-#endif
-#include <max.h>
diff --git a/gnu/lib/libg++/libg++/min.cc b/gnu/lib/libg++/libg++/min.cc
deleted file mode 100644
index 7f0c9b5d0b4..00000000000
--- a/gnu/lib/libg++/libg++/min.cc
+++ /dev/null
@@ -1,4 +0,0 @@
-#ifdef __GNUG__
-#pragma implementation
-#endif
-#include <min.h>
diff --git a/gnu/lib/libg++/libg++/open.cc b/gnu/lib/libg++/libg++/open.cc
deleted file mode 100644
index 7c13ee9ed15..00000000000
--- a/gnu/lib/libg++/libg++/open.cc
+++ /dev/null
@@ -1,46 +0,0 @@
-#include <open.h>
-#pragma implementation
-
-int open_cmd_arg(io_mode i, access_mode a) // decode modes
-{
- int arg;
- switch(i)
- {
- case io_readonly: arg = sio_read; break;
- case io_writeonly: arg = sio_write; break;
- case io_readwrite: arg = sio_readwrite; break;
- case io_appendonly: arg = sio_append | sio_write; break;
- case io_append: arg = sio_append | sio_readwrite; break;
- default: return -1;
- };
- switch(a)
- {
- case a_createonly: return arg | sa_createonly;
- case a_create: return arg | sa_create | sa_truncate;
- case a_useonly: return arg;
- case a_use: return arg | sa_create;
- default: return -1;
- }
-}
-
-char* fopen_cmd_arg(io_mode i)
-{
- switch(i)
- {
- case io_readonly: return "r";
- case io_writeonly: return "w";
- case io_readwrite: return "r+";
- case io_appendonly:return "a";
- case io_append: return "a+";
- default: return 0;
- }
-}
-
-int open_cmd_arg(const char* m)
-{
- if (m == 0) return -1;
- else if (m[0] == 'r') return (m[1] == '+')? io_readwrite : io_readonly;
- else if (m[0] == 'w') return (m[1] == '+')? io_readwrite : io_writeonly;
- else if (m[0] == 'a') return (m[1] == '+')? io_append : io_appendonly;
- else return -1;
-}
diff --git a/gnu/lib/libg++/libg++/ostream.cc b/gnu/lib/libg++/libg++/ostream.cc
deleted file mode 100644
index adee1bd2674..00000000000
--- a/gnu/lib/libg++/libg++/ostream.cc
+++ /dev/null
@@ -1,224 +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 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.
-*/
-
-/* *** Version 1.2 -- nearly 100% AT&T 1.2 compatible *** */
-
-#ifdef __GNUG__
-#pragma implementation
-#endif
-#include <stream.h>
-#include <stdarg.h>
-#include <values.h>
-#include <ctype.h>
-#include <Obstack.h>
-
-ostream::ostream(streambuf* s)
- : bp(s), state(_good), ownbuf(0) {}
-
-ostream::ostream(int sz, char* buf)
- : state(_good), ownbuf(1)
-{
- if (buf == 0)
- {
- buf = new char[sz];
- bp = new streambuf(buf, sz);
- bp->setbuf(buf, sz);
- bp->alloc = 1;
- }
- else
- {
- bp = new streambuf(buf, sz);
- bp->alloc = 0;
- }
-}
-
-
-ostream::ostream(const char* filename, io_mode m, access_mode a)
- : state(_good), ownbuf(1)
-{
- bp = new filebuf(filename, m, a);
-}
-
-ostream::ostream(const char* filename, const char* m)
- : state(_good), ownbuf(1)
-{
- bp = new filebuf(filename, m);
-}
-
-ostream::ostream(int filedesc, io_mode m)
- : state(_good), ownbuf(1)
-{
- bp = new filebuf(filedesc, m);
-}
-
-ostream::ostream(FILE* fileptr)
- : state(_good), ownbuf(1)
-{
- bp = new filebuf(fileptr);
-}
-
-ostream::ostream(int filedesc)
- : state(_good), ownbuf(1)
-{
- bp = new filebuf(filedesc);
-}
-
-ostream::ostream(int filedesc, char* buf, int buflen)
- : state(_good), ownbuf(1)
-{
- bp = new filebuf(filedesc, buf, buflen);
-}
-
-ostream::~ostream()
-{
- if (ownbuf) delete bp;
-}
-
-ostream& ostream::open(const char* filename, io_mode m, access_mode a)
-{
- return failif(bp->open(filename, m, a) == 0);
-}
-
-ostream& ostream::open(const char* filename, const char* m)
-{
- return failif(bp->open(filename, m) == 0);
-}
-
-ostream& ostream::open(int filedesc, io_mode m)
-{
- return failif(bp->open(filedesc, m) == 0);
-}
-
-ostream& ostream::open(FILE* fileptr)
-{
- return failif(bp->open(fileptr) == 0);
-}
-
-ostream& ostream::open(const char* filenam, open_mode m)
-{
- return failif(bp->open(filenam, m) == 0);
-}
-
-ostream& ostream::form(const char* fmt...)
-{
- va_list args;
- va_start(args, fmt);
- char buf[BUFSIZ];
-#ifndef HAVE_VPRINTF
- FILE b;
- b._flag = _IOWRT|_IOSTRG;
- b._ptr = buf;
- b._cnt = BUFSIZ;
- _doprnt(fmt, args, &b);
- putc('\0', &b);
-#else
- vsprintf(buf, fmt, args);
-#endif
- va_end(args);
- return put(buf);
-}
-
-ostream& ostream::operator<<(short n)
-{
- return put(itoa(long(n)));
-}
-
-ostream& ostream::operator<<(unsigned short n)
-{
- return put(itoa((unsigned long)(n)));
-}
-
-ostream& ostream::operator<<(int n)
-{
- return put(itoa(long(n)));
-}
-
-ostream& ostream::operator<<(unsigned int n)
-{
- return put(itoa((unsigned long)(n)));
-}
-
-ostream& ostream::operator<<(long n)
-{
- return put(itoa(n));
-}
-
-ostream& ostream::operator<<(unsigned long n)
-{
- return put(itoa(n));
-}
-
-#ifdef __GNUG__
-#ifndef VMS
-ostream& ostream::operator<<(long long n)
-{
- return put(itoa(n));
-}
-
-ostream& ostream::operator<<(unsigned long long n)
-{
- return put(itoa(n));
-}
-#endif
-#endif
-ostream& ostream::operator<<(float n)
-{
- return put(dtoa(double(n)));
-}
-
-ostream& ostream::operator<<(double n)
-{
- return put(dtoa(n));
-}
-
-ostream& ostream::operator<<(const void* p)
-{
- put("0x");
- return put(itoa((unsigned long)(p), 16));
-}
-
-
-const char* ostream::name()
-{
- return bp->name();
-}
-
-void ostream::error()
-{
- bp->error();
-}
-
-#if 0 /* BSD 4.4 */
-
-ostream cerr(stderr);
-ostream cout(stdout);
-
-#else
-
-static char cerrbuf[1];
-static char coutbuf[BUFSIZE];
-
-ostream cerr(2, cerrbuf, 1);
-ostream cout(1, coutbuf, BUFSIZE);
-
-#endif
diff --git a/gnu/lib/libg++/libg++/std.cc b/gnu/lib/libg++/libg++/std.cc
deleted file mode 100644
index d2bb1140a95..00000000000
--- a/gnu/lib/libg++/libg++/std.cc
+++ /dev/null
@@ -1,4 +0,0 @@
-#ifdef __GNUG__
-#pragma implementation
-#endif
-#include <std.h>
diff --git a/gnu/lib/libg++/libg++/streambuf.cc b/gnu/lib/libg++/libg++/streambuf.cc
deleted file mode 100644
index 4552433d88c..00000000000
--- a/gnu/lib/libg++/libg++/streambuf.cc
+++ /dev/null
@@ -1,138 +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 <streambuf.h>
-
-
-streambuf::streambuf()
- :base(0), gptr(0), pptr(0), eptr(0), alloc(0)
-{}
-
-streambuf::streambuf(char* buf, int buflen)
- : base(buf), gptr(buf), pptr(buf), eptr(buf+buflen-1), alloc(0)
-{}
-
-streambuf::~streambuf()
-{
- if (alloc && (base != 0)) delete base;
-}
-
-int streambuf::doallocate()
-{
- if (alloc && base != 0) delete base;
- base = new char[BUFSIZ];
- gptr = pptr = base;
- eptr = base + BUFSIZ - 1;
- alloc = 1;
- return BUFSIZ;
-}
-
-streambuf* streambuf::setbuf(char* buf, int buflen, int preloaded_count)
-{
- if (alloc && (base != 0)) delete base;
- alloc = 0;
- base = gptr = buf;
- pptr = base + preloaded_count;
- eptr = base + buflen - 1;
- return this;
-}
-
-const char* streambuf::name()
-{
- return 0;
-}
-
-int streambuf::overflow(int c)
-{
- if (base == 0) allocate();
- return (c == EOF)? c : ((pptr <= eptr)? (*pptr++ = (char)(c)) : EOF);
-}
-
-int streambuf::underflow()
-{
- return EOF;
-}
-
-int streambuf::sputs(const char* s)
-{
- if (s != 0)
- {
- for(; *s != 0; ++s)
- {
- if (must_overflow(*s)) { if (overflow(*s) == EOF) return EOF; }
- else *pptr++ = *s;
- }
- }
- return 0;
-}
-
-int streambuf::sputsn(const char* s, int len)
-{
- for(; --len >= 0; ++s)
- {
- if (must_overflow(*s)) { if (overflow(*s) == EOF) return EOF; }
- else *pptr++ = *s;
- }
- return 0;
-}
-
-
-int streambuf::is_open()
-{
- return 1;
-}
-
-int streambuf::close()
-{
- return 1;
-}
-
-void streambuf::error()
-{
- abort();
-}
-
-streambuf* streambuf::open(const char*, open_mode)
-{
- return 0;
-}
-
-streambuf* streambuf::open(const char*, io_mode, access_mode)
-{
- return 0;
-}
-streambuf* streambuf::open(const char*, const char*)
-{
- return 0;
-}
-streambuf* streambuf::open(int, io_mode)
-{
- return 0;
-}
-streambuf* streambuf::open(FILE*)
-{
- return 0;
-}
diff --git a/gnu/lib/libg++/libg++/xyzzy.cc b/gnu/lib/libg++/libg++/xyzzy.cc
deleted file mode 100644
index 8008e05ea5f..00000000000
--- a/gnu/lib/libg++/libg++/xyzzy.cc
+++ /dev/null
@@ -1,12 +0,0 @@
-#ifndef NO_GNULIB3
-// from tiemann
-
-/* Needed, in case there are no other objects which
- need static initialization and cleanup. */
-struct __xyzzy__
-{
- __xyzzy__ () {}
- ~__xyzzy__ () {}
-} __1xyzzy__;
-
-#endif