Index: unk/gsdl/src/library/display.cpp
===================================================================
--- /trunk/gsdl/src/library/display.cpp	(revision 10)
+++ 	(revision )
@@ -1,1527 +1,0 @@
-/**************************************************************************
- *
- * display.cpp -- Context sensitive macro language
- * Copyright (c) 1998 -- Rodger McNab and Hong Chen
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- *
- * $Id$
- *
- **************************************************************************/
-
-/*fopen
-   $Log$
-   Revision 1.1  1998/11/17 01:11:03  sjboddie
-   Initial revision
-
-   Revision 1.8  1998/06/24 01:49:28  rjmcnab
-   Added stuff for the objectspace libraries
-
-   Revision 1.7  1998/06/22 01:05:49  rjmcnab
-   Added a warning when a macro is not found
-
-   Revision 1.6  1998/06/18 23:58:03  rjmcnab
-   changed 'display' to 'displayclass'
-   added support to stream text through display with <<
-
-   Revision 1.5  1998/06/18 00:14:21  rjmcnab
-   fixed a bug in "macro" and added a comment about what
-   the use of macro names
-
-   Revision 1.4  1998/06/17 10:30:00  rjmcnab
-   added a simple _If_ statement
-
-   Revision 1.3  1998/06/17 08:51:08  rjmcnab
-   Added the expansion of macro options, some checking
-   for recursive macro calls, and changed 'set' to
-   'setmacro' in a few places as the MVC++ version 4.2
-   was getting 'set' confused with the STL 'set'
-
-   Revision 1.2  1998/06/15 22:00:29  rjmcnab
-   a lot of restructuring and simplifying
-
-   Revision 1.1  1998/06/13 20:06:05  rjmcnab
-   Initial revision
-
-*/
-
-static char *RCSID = "$Id$";
-
-
-#include "display.h"
-#include <assert.h>
-
-// include to get NULL
-#include <stdlib.h>
-
-#ifdef __GNUG__
-#  include <iostream.h>
-#  include <fstream.h>
-#else
-#  ifndef USE_OBJECTSPACE
-#    include <iostream>
-#    include <fstream>
-#  else
-#    include <ospace\std\iostream>
-#    include <ospace\std\fstream>
-#  endif
-#endif
-
-
-
-
-/////////////////////////////////////
-// misc classes
-/////////////////////////////////////
-
-
-// precedencetype defines a 'precedence value' for each parameter
-typedef map<text_t, double, lttext_t> precedencetype;
-
-
-// macro value structure
-struct mvalue
-{
-  text_t filename;
-  text_t value;
-};
-
-
-
-/////////////////////////////////////
-// stuff for defaultmacros_t
-/////////////////////////////////////
-  
-typedef map<text_t, mvalue, lttext_t> defparammap;
-typedef map<text_t, defparammap, lttext_t> defmacromap;
-typedef map<text_t, defmacromap, lttext_t> defpackagemap;
-
-// all methods in defaultmacros_t assume the parameters
-// and packages in a standard form and not empty
-class defaultmacros_t
-{
-protected:
-  defpackagemap macros;
-
-public:
-  typedef defpackagemap::const_iterator const_package_iterator;
-  typedef defpackagemap::size_type package_size_type;
-
-  // setmacro returns 0 if there was no error,
-  //            -1 if it redefined a macro
-  //            -2 if it hid a Global macro
-  //            -3 if it redefined a macro and hid a Global macro
-  //            -4 if either a package, macroname, or params were not supplied
-  int setmacro(const text_t &package,
-	  const text_t &macroname, 
-	  const text_t &params, 
-	  const text_t &filename, 
-	  const text_t &macrovalue);
-
-  void delmacro(const text_t &package,
-	      const text_t &macroname, 
-	      const text_t &params);
-
-  void clear () {macros.erase(macros.begin(), macros.end());}
-
-  // top level stuff
-  const_package_iterator package_begin () const {return macros.begin();}
-  const_package_iterator package_end () const {return macros.end();}
-  bool package_empty () const {return macros.empty();}
-  package_size_type package_size() const {return macros.size();}
-
-  // methods to find things
-  defmacromap *package_find (const text_t &packagename);
-  defparammap *macro_find (const text_t &packagename, 
-			   const text_t &macroname);
-  mvalue *parameter_find (const text_t &packagename, 
-			  const text_t &macroname,
-			  const text_t &parametername);
-};
-
-
-// setmacro returns 0 if there was no error,
-//            -1 if it redefined a macro
-//            -2 if it hid a Global macro
-//            -3 if it redefined a macro and hid a Global macro
-//            -4 if either a package, macroname, or params were not supplied
-int defaultmacros_t::setmacro(const text_t &package,
-			 const text_t &macroname, 
-			 const text_t &params, 
-			 const text_t &filename, 
-			 const text_t &macrovalue)
-{
-  text_t constGlobal("Global");
-  paramhashtype paramhash;
-
-  defmacromap *macromapptr;
-  defparammap *parammapptr;
-  mvalue *mvalueptr;
-
-  int warning = 0;
-
-  // check to see if we would be hiding a Global macro with the 
-  // same name. Note: it doesn't matter what parameters are used
-  // a Global macro will still be hid by a non-Global one with
-  // the same name.
-  if ((package != constGlobal) && 
-      (macro_find (constGlobal, macroname) != NULL))
-    {
-      warning -= 2; // found the macroname
-    }
-
-  // define this macro
-  macromapptr = &(macros[package]); // -- package
-  parammapptr = &((*macromapptr)[macroname]); // -- macro name
-  // -- parameters
-  if ((*parammapptr).find(params) != (*parammapptr).end()) {
-    warning -= 1; // found the parameters
-  }
-  mvalueptr = &((*parammapptr)[params]);
-
-  // -- value
-  (*mvalueptr).filename = filename;
-  (*mvalueptr).value = macrovalue;
-
-  return warning;
-}
-
-void defaultmacros_t::delmacro(const text_t &package,
-			     const text_t &macroname, 
-			     const text_t &params)
-{
-  // make sure everything was supplied
-  if (package.empty() || macroname.empty() || params.empty()) return;
-
-  // find the package and macroname
-  defparammap *parammapptr = macro_find(package, macroname);
-  if (parammapptr == NULL) return;
-
-  // find the parameters
-  defparammap::iterator parammapit = parammapptr->find(params);
-  if (parammapit == parammapptr->end()) return;
-
-  // finally delete this element
-  parammapptr->erase(parammapit);
-}
-
-defmacromap *defaultmacros_t::package_find (const text_t &packagename)
-{
-  if (packagename.empty()) return NULL;
-
-  defpackagemap::iterator it = macros.find(packagename);
-  if (it == macros.end()) return NULL;
-
-  return &((*it).second);
-}
-
-defparammap *defaultmacros_t::macro_find (const text_t &packagename, 
-					       const text_t &macroname)
-{
-  defmacromap *macromapptr = package_find(packagename);
-  if (macromapptr == NULL || macroname.empty()) return NULL;
-
-  defmacromap::iterator it = (*macromapptr).find(macroname);
-  if (it == (*macromapptr).end()) return NULL;
-
-  return &((*it).second);
-}
-
-mvalue *defaultmacros_t::parameter_find (const text_t &packagename, 
-					 const text_t &macroname,
-					 const text_t &parametername)
-{
-  defparammap *parammapptr = macro_find(packagename, macroname);
-  if (parammapptr == NULL || parametername.empty()) return NULL;
-
-  defparammap::iterator it = (*parammapptr).find(parametername);
-  if (it == (*parammapptr).end()) return NULL;
-
-  return &((*it).second);
-}
-
-
-
-/////////////////////////////////////
-// stuff for currentmacros_t
-/////////////////////////////////////
-
-typedef map<text_t, mvalue, lttext_t> curmacromap;
-typedef map<text_t, curmacromap, lttext_t> curpackagemap;
-
-// all methods in currentmacros_t assume the parameters
-// and packages in a standard form and not empty
-class currentmacros_t 
-{
-protected:
-  curpackagemap macros;
-
-public:
-  typedef curpackagemap::const_iterator const_package_iterator;
-  typedef curpackagemap::size_type package_size_type;
-
-  // setmacro returns 0 if there was no error,
-  //            -1 if it redefined a macro
-  //            -4 if either a package, or macroname were not supplied
-  int setmacro(const text_t &package,
-	  const text_t &macroname, 
-	  const text_t &filename, 
-	  const text_t &macrovalue);
-
-  void delmacro(const text_t &package,
-		const text_t &macroname);
-
-  void clear () {macros.erase(macros.begin(), macros.end());}
-
-  // top level stuff
-  const_package_iterator package_begin () const {return macros.begin();}
-  const_package_iterator package_end () const {return macros.end();}
-  bool package_empty () const {return macros.empty();}
-  package_size_type package_size() const {return macros.size();}
-
-  // methods to find things
-  curmacromap *package_find (const text_t &packagename);
-  mvalue *macro_find (const text_t &packagename, 
-		      const text_t &macroname);
-};
-
-
-// setmacro returns 0 if there was no error,
-//            -1 if it redefined a macro
-//            -4 if either a package, or macroname were not supplied
-int currentmacros_t::setmacro(const text_t &package,
-			 const text_t &macroname, 
-			 const text_t &filename, 
-			 const text_t &macrovalue)
-{
-  int warning = 0;
-
-  // make sure everything was supplied
-  if (package.empty() || macroname.empty()) return -4;
-
-  // define this macro
-  curmacromap *macromapptr = &(macros[package]);
-  if ((*macromapptr).find(macroname) != (*macromapptr).end()) 
-    {
-      warning -= 1; // found the macroname
-    }
-  mvalue *mvalueptr = &((*macromapptr)[macroname]);
-
-  // -- value
-  (*mvalueptr).filename = filename;
-  (*mvalueptr).value = macrovalue;
-
-  return warning;
-}
-
-void currentmacros_t::delmacro(const text_t &package,
-			     const text_t &macroname)
-{
-  // make sure everything was supplied
-  if (package.empty() || macroname.empty()) return;
-
-  // find the package
-  curmacromap *macromapptr = package_find(package);
-  if (macromapptr == NULL) return;
-
-  // find the macroname
-  curmacromap::iterator macromapit = macromapptr->find(macroname);
-  if (macromapit == macromapptr->end()) return;
-
-  // finally delete this element
-  macromapptr->erase(macromapit);
-}
-
-curmacromap *currentmacros_t::package_find (const text_t &packagename)
-{
-  if (packagename.empty()) return NULL;
-
-  curpackagemap::iterator it = macros.find(packagename);
-  if (it == macros.end()) return NULL;
-
-  return &((*it).second);
-}
-
-mvalue *currentmacros_t::macro_find (const text_t &packagename, 
-				     const text_t &macroname)
-{
-  curmacromap *macromapptr = package_find(packagename);
-  if (macromapptr == NULL || macroname.empty()) return NULL;
-
-  curmacromap::iterator it = (*macromapptr).find(macroname);
-  if (it == (*macromapptr).end()) return NULL;
-
-  return &((*it).second);
-}
-
-
-
-
-/////////////////////////////////////
-// support functions
-/////////////////////////////////////
-
-// this calculation of precedence will make one occurance of a high
-// precedence item override many occurances of lower precedence items
-void calcprecedence (const text_t &precedstr, precedencetype &precedhash) 
-{
-  text_t param;
-  double multiple = 5.0;
-  double nextprec = multiple;
-
-  text_t::const_iterator here, end;
-
-  // set precedhash to an empty hash
-  precedhash.erase(precedhash.begin(), precedhash.end());
-
-  // iterate through paramstring ignoring space and extracting
-  // out key value pairs.
-  here = precedstr.begin();
-  end = precedstr.end();
-  while (here != end) 
-    {
-      // get the next parameter
-      param.clear(); // set param to an empty string
-      
-      while (here != end) 
-	{
-	  if (*here == ',') 
-	    {
-	      // found the end of the parameter
-	      here++;
-	      break;
-	    } 
-	  else if (*here == ' ') 
-	    {
-	      // do nothing (ignore spaces)
-	    } 
-	  else 
-	    {
-	      // character in parameter
-	      param.push_back (*here); // copy this character
-	    }
-	  
-	  here++;
-	}
-
-      // if a parameter was found insert its value
-      if (!param.empty()) 
-	{
-	  precedhash[param] = nextprec;
-	  nextprec *= multiple;
-	}
-    }
-}
-
-
-// decides how specific any given parameter is to the page parameters. Returns 
-// negative if any options are different or else the sum of the precedence for
-// the options which match. 
-double getspecificness(const paramhashtype &pageparams, 
-		       const paramhashtype &theseparams, 
-		       const precedencetype &precedhash) 
-{
-  double specificness = 0.0;
-  paramhashtype::const_iterator here, pagevalueit;
-  precedencetype::const_iterator precedit;
-  text_t thesekey, thesevalue, constignore("ignore");
-  
-  here = theseparams.begin();
-  while (here != theseparams.end()) 
-    {
-      thesekey = (*here).first;
-      thesevalue = (*here).second;
-      
-      if (thesekey == constignore) 
-	{
-	  // do nothing, this is a placeholder
-	} 
-      else 
-	{
-	  pagevalueit = pageparams.find(thesekey);
-	  if ((pagevalueit != pageparams.end()) && 
-	      ((*pagevalueit).second == thesevalue)) 
-	    {
-	      // this parameter fits, add its precedence value
-	      precedit = precedhash.find(thesekey);
-	      if (precedit == precedhash.end()) 
-		specificness += 1.0; // no precedence defined
-	      else 
-		  specificness += (*precedit).second;
-	    }
-	  else 
-	    {
-	      return -1.0; // did not match
-	    }
-	}
-
-      here++;
-    }
-  
-  return specificness;
-}
-
-
-void splitparams (const text_t &paramstring, paramhashtype &paramhash)
-{
-  text_t key;
-  text_t value;
-
-  text_t::const_iterator here, end;
-
-  // set paramhash to an empty hash
-  paramhash.erase(paramhash.begin(), paramhash.end());
-
-  // iterate through paramstring ignoring space and extracting
-  // out key value pairs.
-  here = paramstring.begin();
-  end  = paramstring.end();
-  while (here != end) 
-    {
-      // reset key and value
-      key.clear();
-      value.clear();
-
-      // get key
-      while (here != end) 
-	{
-	  if (*here == ',') 
-	    {
-	      // have a key with no value
-	      break;
-	    } 
-	  else if (*here == '=') 
-	    {
-	      // found the end of the key
-	      here ++; 
-	      break;
-	    } 
-	  else if (*here == ' ') 
-	    {
-	      // do nothing (ignore spaces)
-	    } 
-	  else 
-	    {
-	      // character in key
-	      key.push_back (*here); // copy this character
-	    }
-	  here ++;
-	}
-
-      // get value
-      while (here != end) 
-	{
-	  if (*here == '=') 
-	    {
-	      // multiple values for one key, ignore previous
-	      // values
-	      value.clear();
-	    } 
-	  else if (*here == ',') 
-	    {
-	      // found the end of the value
-	      here ++;
-	      break;
-	    } 
-	  else if (*here == ' ') 
-	    {
-	      // do nothing (ignore spaces)
-	    } 
-	  else 
-	    {
-	      // character in value
-	      value.push_back (*here); // copy this character
-	    }
-	  here ++;
-	}
-    
-      // if a key was found insert the key/value pair in 
-      // the map 
-      if (!key.empty()) 
-	{
-	  paramhash[key] = value;
-	}
-    }
-}
-
-
-void joinparams (const paramhashtype &paramhash, text_t &paramstring)
-{
-  //set paramstring to an empty string
-  paramstring.clear();
-
-  //iterate through the paramhash
-  paramhashtype::const_iterator thepair;
-  int firstparam = 1;
-
-  for (thepair=paramhash.begin();thepair!=paramhash.end(); thepair++)
-    {
-      if (!firstparam) paramstring.push_back(',');
-      firstparam = 0;
-      
-      // insert pairs of "key=value"
-      text_t thevalue;
-      paramstring.append((*thepair).first);
-      paramstring.push_back('=');
-      paramstring.append((*thepair).second);
-    }
-}
-
-
-
-/////////////////////////////////////
-// parsing support functions
-/////////////////////////////////////
-
-inline int my_isspace (char ch) 
-{
-  unsigned char c = ch;
-  return (((c > 0) && (c <= 31)) || (c == ' '));
-}
-
-
-inline int my_isalpha (char c) 
-{
-  return ((c >= 'A' && c <= 'Z') ||
-	  (c >= 'a' && c <= 'z'));
-} 
-
-
-// as we are using one character lookahead the
-// value of line might be off by one.
-inline char my_get (istream &fin, int &line) 
-{
-  char c;
-  fin.get(c);
-  if (c == '\n') line++;
-  return c;
-}
-
-
-inline unsigned short my_ttnextchar (text_t::const_iterator &here, 
-				     text_t::const_iterator &end) 
-{
-  if (here != end) 
-    {
-      here++;
-      if (here != end) return (*here);
-    }
-  return '\0';
-}
-
-
-
-/////////////////////////////////////
-// methods for display
-/////////////////////////////////////
-
-// public methods for display
-
-displayclass::displayclass ()
-{
-  defaultmacros = new defaultmacros_t;
-  defaultfiles = new fileinfomap;
-  
-  orderparamlist = new paramspeclist;
-  currentmacros = new currentmacros_t;
-
-  outc = NULL;
-}
-
-
-displayclass::~displayclass ()
-{
-  delete defaultmacros;
-  delete defaultfiles;
-  
-  delete orderparamlist;
-  delete currentmacros;
-}
-  
-// setdefaultmacro adds an entry to the list of default macros 
-// returns 0 if there was no error,
-//        -1 if it redefined a macro
-//        -2 if it hid a Global macro
-//        -3 if it redefined a macro and hid a Global macro
-//        -4 if no macroname was supplied
-int displayclass::setdefaultmacro (text_t package, const text_t &macroname, 
-			      text_t params, const text_t &macrovalue) 
-{
-  return setdefaultmacro (macroname, package, params, macrovalue, "memory");
-}
-
-
-
-// loads a default macro file (if it isn't already loaded)
-// returns 0 if didn't need to load the file (it was already loaded)
-//         1 if was (re)loaded
-//        -1 an error occurred while trying to load the file
-int displayclass::loaddefaultmacros (text_t thisfilename)
-{
-  // convert the filename to a C string
-  char *filenamestr = thisfilename.getcstr();
-  outconvertclass text_t2ascii;
-
-  // see if we need to open this file -- this isn't implemented yet
-  
-  // open the file
-  ifstream fin(filenamestr);
-  if (fin.fail()) return -1; // read failed
-
-  text_t package = "Global";
-  int line  = 1;
-  char c = my_get(fin, line); // pre-fetch the next character
-
-  text_t macropackage, macroname, macroparameters, macrovalue;
-  int err; // for keeping track of whether an error occurred somewhere
-
-  while (!fin.eof()) 
-    {
-      // expect: white space, comment, "package", or macroname
-      if (my_isspace(c)) 
-	{
-	  // found some white-space
-	  c = my_get(fin, line);
-	}
-      else if (c == '#') 
-	{
-	  // found the start of a comment
-	  // skip all characters up to the end of the line
-	  c = my_get(fin, line); // skip the '#'
-	  while (!fin.eof ()) 
-	    {
-	      if (c == '\n') break;
-	      c = my_get(fin, line);
-	    }
-
-	} 
-      else if (c == 'p') 
-	{
-	  // found the start of 'package' (hopefully)
-	  // get everything up to the next space
-	  text_t tmp;
-	  while (!fin.eof() && my_isalpha(c)) 
-	    {
-	      tmp.push_back((unsigned char)c);
-	      c = my_get(fin, line);
-	    }
-	  // see if we have a package name
-	  if (tmp == "package") 
-	    {
-	      // skip all white space
-	      while (!fin.eof() && my_isspace(c)) 
-		c = my_get(fin, line);
-
-	      // get the package name
-	      tmp.clear(); // init tmp
-	      while (!fin.eof() && my_isalpha(c)) 
-		{
-		  tmp.push_back((unsigned char)c);
-		  c = my_get(fin, line);
-		}
-	      package = tmp;
-	      if (package.empty()) package = "Global";
-
-	    } 
-	  else 
-	    {
-	      // error
-	      cerr << "Expected 'package' on line " << line << "\n";
-	    }
-
-	} 
-      else if (c == '_') 
-	{
-	  // found the start of a macro (hopefully)
-	  c = my_get(fin, line); // skip the _
-
-	  // init variables
-	  err = 0;
-	  macropackage = package;
-	  macroname.clear(); // init macroname
-	  macroparameters.clear(); // init macroname
-	  macrovalue.clear(); // init macroname
-
-	  // get the macro name
-	  while ((!fin.eof()) && (!my_isspace(c)) && 
-		 (c != '\\') && (c != '_') &&(c != ':') && 
-		 (macroname.size() < 80)) 
-	    {
-	      macroname.push_back((unsigned char)c);
-	      c = my_get(fin, line);
-	    }
-	  
-	  if (c == ':') 
-	    {
-	      // we actually had the macro package
-	      c = my_get(fin, line); // skip :
-	      macropackage = macroname;
-	      macroname.clear ();
-
-	      // get the macro name (honest!)
-	      while ((!fin.eof()) && (!my_isspace(c)) && 
-		     (c != '\\') && (c != '_') &&(c != ':') && 
-		     (macroname.size() < 80)) 
-		{
-		  macroname.push_back((unsigned char)c);
-		  c = my_get(fin, line);
-		}
-	    }
-
-	  if (!err && c == '_') 
-	    {
-	      c = my_get(fin, line); // skip the _
-
-	      // skip all white space
-	      while (!fin.eof() && my_isspace(c)) c = my_get(fin, line);
-	    } 
-	  else err = 1;
-
-	  // get the macro parameters (optional)
-	  if (!err && c == '[') 
-	    {
-	      c = my_get(fin, line); // skip the [
-	      while ((!fin.eof()) && (c != '\n') && (c != '\\') && (c != ']')) 
-		{
-		  macroparameters.push_back((unsigned char)c);
-		  c = my_get(fin, line);
-		}
-
-	      if (c == ']') 
-		{
-		  c = my_get(fin, line); // skip the ]
-	  
-		  // skip all white space
-		  while (!fin.eof() && my_isspace(c)) c = my_get(fin, line);
-		} 
-	      else err = 2;
-	    }
-
-	  // get the macro value
-	  if (!err && c == '{') 
-	    {
-	      c = my_get(fin, line); // skip the {
-	      while ((!fin.eof()) && (c != '}')) 
-		{
-		  if (c == '\\') 
-		    {
-		      macrovalue.push_back((unsigned char)c); // keep the '\'
-		      c = my_get(fin, line); // store the *next* value regardless
-		      if (!fin.eof()) macrovalue.push_back((unsigned char)c);
-		      c = my_get(fin, line);
-		    }
-		  macrovalue.push_back((unsigned char)c);
-		  c = my_get(fin, line);
-		}
-
-	      if (c == '}') 
-		{
-		  c = my_get(fin, line); // skip the }
-	  
-		  // define the macro
-		  err = setdefaultmacro (macropackage, macroname, macroparameters,
-					 thisfilename, macrovalue);
-		  if (err == -1 || err == -3) 
-		    {
-		      cerr << text_t2ascii << "Warning: redefinition of _" << 
-			package << ":" << macroname << "_[" << macroparameters <<
-			"] on line ";
-		      cerr << line;
-		      cerr << text_t2ascii << " of " << thisfilename << "\n";
-	    
-		    } 
-		  else if (err == -2) 
-		    {
-		      cerr << text_t2ascii << "Warning: _" << 
-			package << ":" << macroname << "_[" << macroparameters <<
-			"] on line ";
-		      cerr << line;
-		      cerr << text_t2ascii << " of " << 
-			thisfilename << " hides a Global macro with the same name\n";
-	    
-		    } 
-		  else if (err == -4) 
-		    {
-		      cerr << text_t2ascii << "Error: macro name expected on line ";
-		      cerr << line ;
-		      cerr << text_t2ascii << " of " << thisfilename << "\n";
-		    }		  
-	  
-		  err = 0; // for the test below
-		} 
-	      else err = 3;
-	    } 
-	  else err = 4;
-
-	  if (err) 
-	    {
-	      // found an error, skip to the end of the line
-	      cerr << text_t2ascii << "Err: Unexpected input on line ";
-	      cerr << line;
-	      cerr << text_t2ascii << " (";
-	      cerr << err;
-	      cerr << text_t2ascii << ")\n";
-	      while (!fin.eof ()) 
-		{
-		  if (c == '\n') break;
-		  c = my_get(fin, line);
-		}
-	    }
-
-	} 
-      else 
-	{
-	  // found an error, skip to the end of the line
-	  cerr << "Error: Unexpected input on line " << line << "\n";
-	  while (!fin.eof ()) 
-	    {
-	      if (c == '\n') break;
-	      c = my_get(fin, line);
-	    }
-      
-	}
-    }
-  
-  fin.close ();
-  
-  // free up memory
-  delete filenamestr;
-  return 0;
-}
-
-
-// prepares to create a page.
-void displayclass::openpage (const text_t &thispageparams, 
-			const text_t &thisprecedence)
-{
-  // init variables
-  currentmacros->clear();
-
-  // reload any default macro files which have changed.
-  if (checkdefaultmacrofiles() < 0) 
-    {
-      // print error message
-    }
-
-  setpageparams (thispageparams, thisprecedence);
-}
-
-
-// changes the parameters for the current page.
-void displayclass::setpageparams (text_t thispageparams, 
-			     text_t thisprecedence)
-{
-  paramhashtype thissplitparams, splittheseparams;
-  precedencetype precedhash;
-  text_tset::iterator text_tsetit;
-  paramspec tmpps;
-
-  precedence = thisprecedence;
-  calcprecedence(thisprecedence, precedhash);
-
-  splitparams(thispageparams, thissplitparams);
-  joinparams(thissplitparams, thispageparams);
-  params = thispageparams;
-
-  // get a list of parameters with their specificness
-  orderparamlist->erase(orderparamlist->begin(), orderparamlist->end());
-  for (text_tsetit=allparams.begin();
-       text_tsetit!=allparams.end();
-       text_tsetit++) 
-    {
-      tmpps.param = (*text_tsetit);
-      splitparams(tmpps.param, splittheseparams);
-      tmpps.spec = getspecificness(thissplitparams, splittheseparams, precedhash);
-      if (tmpps.spec >= 0) 
-	{
-	  orderparamlist->push_back (tmpps);
-	}
-    }
-
-  // sort the list
-  sort(orderparamlist->begin(), orderparamlist->end());
-
-//   paramspeclist::iterator pshere = orderparamlist->begin();
-//   paramspeclist::iterator psend = orderparamlist->end();
-//   while (pshere != psend) 
-//     {
-//       cerr << text_t2ascii << "param=" << (*pshere).param;
-//       cerr << " spec=" << (int)((*pshere).spec) << "\n";
-//       pshere++;
-//     }
-}
-
-
-// overrides (or sets) a macro for the current page.
-// returns 0 if there was no error,
-//        -1 if it redefined a macro
-//        -4 if no macroname was supplied
-int displayclass::setmacro (const text_t &macroname, 
-		       text_t package, 
-		       const text_t &macrovalue)
-{
-  // make sure a macroname was supplied
-  if (macroname.empty()) return -4;
-
-  // make package "Global" if it doesn't point to anything yet
-  if (package.empty()) package = "Global";
-
-  // set the macro
-  return currentmacros->setmacro(package, macroname, "memory", macrovalue);
-}
-
-
-void displayclass::expandstring (const text_t &inputtext, text_t &outputtext)
-{
-  expandstring("", inputtext, outputtext);
-}
-
-
-void displayclass::expandstring (text_t package, const text_t &inputtext,
-			    text_t &outputtext, int recursiondepth)
-{
-  text_t macroname, macropackage, macroargs;
-  text_t::const_iterator tthere = inputtext.begin();
-  text_t::const_iterator ttend = inputtext.end();
-  unsigned short c;
-
-  if (package.empty()) package = "Global";
-
-  outputtext.clear();
-      
-  // use one-character lookahead
-  if (tthere != ttend) c = (*tthere);
-  while (tthere != ttend) 
-    {
-      if (c == '\\')
-	{
-	  // found an escape character
-	  c = my_ttnextchar (tthere, ttend); // skip the escape character
-	  if (tthere != ttend) 
-	    {
-	      if (c == 'n') outputtext.push_back('\n');
-	      else if (c == 't') outputtext.push_back('\t');
-	      else outputtext.push_back(c);
-	    }
-	  c = my_ttnextchar (tthere, ttend);
-	  
-	} 
-      else if (c == '_') 
-	{
-	  // might have found the start of a macro
-      
-	  // embedded macros (macros within the names
-	  // of other macros) are no longer supported -- Rodger.
-      
-	  // save the current state (in case we need to back out)
-	  text_t::const_iterator savedtthere = tthere;
-	  unsigned short savedc = c;
-	  
-	  macroname.clear();
-	  macropackage = package;
-	  macroargs.clear();
-      
-	  c = my_ttnextchar (tthere, ttend); // skip the '_'
-	  
-	  // get the macroname
-	  while (tthere != ttend && (!my_isspace(c)) && 
-		 (c != '\\') && (c != '_') &&(c != ':') && 
-		 (macroname.size() < 80)) 
-	    {
-	      macroname.push_back((unsigned char)c);
-	      c = my_ttnextchar (tthere, ttend);
-	    }
-      
-	  if (c == ':') 
-	    {
-	      // we actually had the macro package
-	      c = my_ttnextchar (tthere, ttend);
-	      macropackage = macroname;
-	      macroname.clear ();
-	
-	      // get the macro name (honest!)
-	      while ((tthere != ttend) && (!my_isspace(c)) && 
-		     (c != '\\') && (c != '_') &&(c != ':') && 
-		     (macroname.size() < 80)) 
-		{
-		  macroname.push_back((unsigned char)c);
-		  c = my_ttnextchar (tthere, ttend);
-		}
-	    }
-      
-	  if ((tthere != ttend) && (c == '_') &&
-	      (macroname.size() > 0)) 
-	    {
-	      // found a macro!!!! (maybe)
-	
-	      c = my_ttnextchar (tthere, ttend); // skip the '_'
-	
-	      // get the parameters (if there are any)
-	      if ((tthere != ttend) && (c == '(')) 
-		{
-		  c = my_ttnextchar (tthere, ttend); // skip '('
-	  
-		  // have to be careful of quotes
-		  unsigned short quote = '\0';
-		  while (tthere != ttend) 
-		    {
-		      if (c == '\\') 
-			{
-			  // have an escape character, save escape 
-			  // character and next character as well
-			  macroargs.push_back (c);
-			  c = my_ttnextchar (tthere, ttend); 
-	      
-			} 
-		      else if (quote == '\0') 
-			{
-			  // not in a quote at the moment
-			  if (c == ')') 
-			    {
-			      // found end of the arguments
-			      c = my_ttnextchar (tthere, ttend); // skip ')'
-			      break;
-		
-			    } 
-			  else if (c == '\'' || c == '\"') 
-			    {
-			      // found a quote
-			      quote = c;
-			    }
-	      
-			} 
-		      else 
-			{
-			  // we are in a quote
-			  if (c == quote) quote = '\0';
-			}
-	    
-		      // save this character
-		      if (tthere != ttend) macroargs.push_back (c);
-		      c = my_ttnextchar (tthere, ttend);
-		    }
-		}
-	
-	      //
-	      // we now have the macropackage, macroname, and macroargs
-	      //
-	
-	      // try to expand out this macro
-	      text_t expandedmacro;
-	      if (macro (macroname, macropackage, macroargs, expandedmacro, recursiondepth)) 
-		{
-		  // append the expanded macro
-		  outputtext += expandedmacro;
-		} 
-	      else
-		{
-		  // wasn't a macro
-		  tthere = savedtthere;
-		  c = savedc;
-		  outputtext.push_back(c); // the '_'
-		  c = my_ttnextchar (tthere, ttend);
-		}
-	
-
-	    }
-	  else
-	    {
-	      // wasn't a macro
-	      tthere = savedtthere;
-	      c = savedc;
-	      outputtext.push_back(c); // the '_'
-	      c = my_ttnextchar (tthere, ttend);
-	    }
-
-	}
-      else 
-	{
-	  // nothing of interest
-	  outputtext.push_back(c); // the '_'
-	  c = my_ttnextchar (tthere, ttend);
-	}
-    }
-}
-
-
-// protected methods for display
-
-// reloads any default macro files which have changed
-// returns 0 no errors occurred
-//        -1 an error occurred while trying to load one of the files
-int displayclass::checkdefaultmacrofiles ()
-{
-  // this isn't implemented yet
-  return 0;
-}
-
-// setdefaultmacro adds an entry to the list of default macros 
-// returns 0 if there was no error,
-//        -1 if it redefined a macro
-//        -2 if it hid a Global macro
-//        -3 if it redefined a macro and hid a Global macro
-//        -4 if no macroname was supplied
-int displayclass::setdefaultmacro (text_t package, const text_t &macroname, 
-			      text_t params, const text_t &filename,
-			      const text_t &macrovalue) 
-{
-  // make sure a macroname was supplied
-  if (macroname.empty()) return -4;
-
-  // put the parameters in a standard form
-  paramhashtype paramhash;
-  if (params.empty()) params = "ignore=yes";
-  splitparams (params, paramhash);
-  joinparams (paramhash, params);
-
-  // make package "Global" if it doesn't point to anything yet
-  if (package.empty()) package = "Global";
-
-  // remember these parameters
-  allparams.insert (params);
-
-  // remember this filename (this part isn't finished yet -- Rodger).
-
-  // set the macro
-  return defaultmacros->setmacro(package, macroname, params, filename, macrovalue);
-}
-
-// (recursively) expand out a macro
-// returns true  if the macro was found
-//         false if the macro was not found
-bool displayclass::macro (const text_t &macroname, text_t macropackage, 
-		     const text_t &macroparam, text_t &outputtext,
-		     int recursiondepth)
-{
-  outconvertclass text_t2ascii;
-  text_tlist splitmacroparam;
-  text_t::const_iterator hereit, endit;
-  text_t aparam;
-  unsigned short c, quote;
-
-  //  cerr << "r: " << recursiondepth << "\n";
-
-  // check for deep recursion
-  if (recursiondepth >= MAXRECURSIONDEPTH)
-    {
-      cerr << "Warning: deep recursion, limiting macro expansion\n";
-      return false;
-    }
-
-  // check the macropackage
-  if (macropackage.empty()) macropackage = "Global";
-
-  // get the parameters (but don't expand them)
-  if (macroparam.size() > 0) {
-    // set up for loop
-    hereit = macroparam.begin();
-    endit = macroparam.end();
-    if (hereit != endit) c = (*hereit);
-
-    while (hereit != endit) {
-      // get the next parameter
-      aparam.clear();
-      quote = '\0'; // not-quoted unless proven quoted
-      
-      // ignore initial whitespace
-      while ((hereit!=endit)&&my_isspace(c)) c=my_ttnextchar(hereit,endit);
-      
-      // look for the end of the parameter
-      while (hereit != endit) {
-	if (c == '\\') {
-	  // found escape character, also get next character
-	  aparam.push_back(c);
-	  c = my_ttnextchar (hereit, endit);
-	  if (hereit != endit) aparam.push_back(c);
-	  
-	} else if (quote=='\0' && (c=='\'' || c=='"')) {
-	  // found a quoted section
-	  quote = c;
-
-	} else if (quote!='\0' && c==quote) {
-	  // found the end of a quote
-	  quote = '\0';
-
-	} else if (quote=='\0' && c==',') {
-	  // found the end of a parameter
-	  c = my_ttnextchar (hereit, endit);
-	  break;
-
-	} else {
-	  // ordinary character
-	  aparam.push_back(c);
-	}
-
-	c = my_ttnextchar (hereit, endit);
-      }
-
-      // add this parameter to the list
-      splitmacroparam.push_back(aparam);
-    }
-  }
-
-  // I'm only supporting a simple version of _If_ at the moment
-  if (macroname == "If")
-    {
-      // get the condition, then clause and else clause
-      text_tlist::iterator paramcond = splitmacroparam.begin();
-      text_tlist::iterator paramend = splitmacroparam.end();
-      text_tlist::iterator paramthen = paramend;
-      text_tlist::iterator paramelse = paramend;
-
-      if (paramcond != paramend)
-	{
-	  paramthen = paramcond;
-	  paramthen++;
-	}
-      if (paramthen != paramend)
-	{
-	  paramelse = paramthen;
-	  paramelse++;
-	}
-
-      // will always output something
-      outputtext.clear();
-
-      // expand out the first parameter
-      if (paramcond != paramend)
-	{
-	  text_t tmpoutput;
-	  expandstring (macropackage, *paramcond, tmpoutput, recursiondepth+1);
-	  
-	  // test the expanded string
-	  if (tmpoutput.size() > 1 || 
-	      (tmpoutput.size() == 1 && tmpoutput[0] != '0'))
-	    {
-	      // true
-	      if (paramthen != paramend)
-		expandstring (macropackage, *paramthen, outputtext, recursiondepth+1);
-	    }
-	  else
-	    {
-	      // false
-	      if (paramelse != paramend)
-		expandstring (macropackage, *paramelse, outputtext, recursiondepth+1);
-	    }
-	}
-
-      return true;
-    }
-
-  // try and find this macro
-
-  // this list might be replaced by something a little more
-  // sophisticated in the future.
-  text_tlist packagelist;
-  packagelist.push_back (macropackage);
-  packagelist.push_back ("Global");
-
-  paramspeclist::iterator paramhere, paramend;
-  text_tlist::iterator packagehere = packagelist.begin();
-  text_tlist::iterator packageend = packagelist.end();
-  mvalue *macrovalue = NULL;
-  while ((macrovalue == NULL) && (packagehere != packageend)) 
-    {
-      // first look in the currentmacros
-      macrovalue = currentmacros->macro_find(*packagehere, macroname);
-      if (macrovalue == NULL)
-	macrovalue = currentmacros->macro_find("Style", macroname);
-
-      // look in the default macros
-      if (macrovalue == NULL) 
-	{
-	  // next look in the defaultmacros
-	  if (defaultmacros->macro_find (*packagehere, macroname) != NULL)
-	    {
-	      paramhere = orderparamlist->begin(); paramend = orderparamlist->end();
-	      while ((macrovalue == NULL) && (paramhere != paramend))
-		{
-// 		  cerr << text_t2ascii << "\npackage: " << *packagehere << "\n";
-// 		  cerr << text_t2ascii << "macroname: " << macroname << "\n";
-// 		  cerr << text_t2ascii << "param: " << (*paramhere).param << "\n";
-// 		  cerr << "spec: " << (int)((*paramhere).spec) << "\n";
-		  macrovalue = defaultmacros->parameter_find(*packagehere, macroname,
-							     (*paramhere).param);
-		  paramhere++;
-		}
-	    }
-	}
-
-      // and again in the package "Style"
-      if (macrovalue == NULL) 
-	{
-	  // next look in the defaultmacros
-	  if (defaultmacros->macro_find ("Style", macroname) != NULL)
-	    {
-	      paramhere = orderparamlist->begin(); paramend = orderparamlist->end();
-	      while ((macrovalue == NULL) && (paramhere != paramend))
-		{
-		  macrovalue = defaultmacros->parameter_find("Style", macroname,
-							     (*paramhere).param);
-		  paramhere++;
-		}
-	    }
-	}
-      if (macrovalue == NULL) packagehere++;
-    }
-
-  if (macrovalue != NULL)
-    {
-      // we found a macro
-
-      // replace all the option macros (_1_, _2_, ...) in the 
-      // value of this macro
-      text_t tempmacrovalue;
-      tempmacrovalue.clear();
-      hereit = macrovalue->value.begin();
-      endit = macrovalue->value.end();
-      if (hereit != endit) c = (*hereit);
-      while (hereit != endit)
-	{
-	  if (c == '\\')
-	    {
-	      // found an escape character
-	      tempmacrovalue.push_back(c);
-	      c = my_ttnextchar (hereit, endit);
-	      if (hereit != endit) tempmacrovalue.push_back(c);
-	      c = my_ttnextchar (hereit, endit);
-	    }
-	  else if (c == '_')
-	    {
-	      text_t::const_iterator savedhereit = hereit;
-	      unsigned short c2 = my_ttnextchar (hereit, endit);
-	      unsigned short c3 = my_ttnextchar (hereit, endit);
-	      if ((c2 >= '1') && (c2 <= '9') && (c3 == '_'))
-		{
-		  // found an option macro, append the appropriate text
-		  text_tlist::iterator ttlisthere = splitmacroparam.begin();
-		  text_tlist::iterator ttlistend = splitmacroparam.end();
-		  while ((c2 > '1') && (ttlisthere != ttlistend))
-		    {
-		      c2--;
-		      ttlisthere++;
-		    }
-		  if (ttlisthere != ttlistend)
-		    tempmacrovalue.append(*ttlisthere);
-
-		  c = my_ttnextchar (hereit, endit);
-
-		}
-	      else
-		{
-		  // wasn't a option macro
-		  tempmacrovalue.push_back(c);
-		  hereit = savedhereit;
-		  c = my_ttnextchar (hereit, endit);
-		}
-	    }
-	  else
-	    {
-	      tempmacrovalue.push_back(c);
-	      c = my_ttnextchar (hereit, endit);
-	    }
-	}
-      
-      // recursively replace this macro
-      expandstring (*packagehere, tempmacrovalue, outputtext, recursiondepth+1);
-
-      return true;
-    }
-
-  cerr << text_t2ascii << "Warning: _" << 
-    macropackage << ":" << macroname << "_ not found\n";
-  
-  return false; // didn't find the macro
-}
-
-
-void displayclass::printdefaultmacros ()
-{
-  defpackagemap::const_iterator packagemapit;
-  defmacromap::const_iterator macromapit;
-  defparammap::const_iterator parammapit;
-  const mvalue *mvalueptr;
-  outconvertclass text_t2ascii;
-
-  text_t packagename, macroname, macroparam;
-  
-  for (packagemapit = defaultmacros->package_begin();
-       packagemapit != defaultmacros->package_end();
-       packagemapit++) 
-    {
-      packagename = (*packagemapit).first;
-      //     cerr << "***package   : \"" << packagename << "\"\n";
-    
-      for (macromapit = (*packagemapit).second.begin();
-	   macromapit != (*packagemapit).second.end();
-	   macromapit++) 
-	{
-	  macroname = (*macromapit).first;
-	  //       cerr << "***macroname : \"" << macroname << "\"\n";
-
-	  for (parammapit = (*macromapit).second.begin();
-	       parammapit != (*macromapit).second.end();
-	       parammapit++) 
-	    {
-	      macroparam = (*parammapit).first;
-	      mvalueptr = &((*parammapit).second);
-	      cerr << text_t2ascii << "package   : \"" << packagename << "\"\n";
-	      cerr << text_t2ascii << "macroname : \"" << macroname << "\"\n";
-	      cerr << text_t2ascii << "parameters: [" << macroparam << "]\n";
-	      cerr << text_t2ascii << "filename  : \"" << mvalueptr->filename << "\"\n";
-	      cerr << text_t2ascii << "value     : {" << mvalueptr->value << "}\n\n";
-	    }
-	}
-    }
-}
-
-void displayclass::printallparams ()
-{
-  text_tset::iterator text_tsetit;
-  outconvertclass text_t2ascii;
-
-  cerr << text_t2ascii << "** allparams\n";
-  for (text_tsetit=allparams.begin();
-       text_tsetit!=allparams.end();
-       text_tsetit++) {
-    cerr << text_t2ascii << (*text_tsetit) << "\n";
-  }
-  cerr << text_t2ascii << "\n";
-}
-
-
-
-/////////////////////////////////////
-// stuff to do tricky output
-/////////////////////////////////////
-
-displayclass &operator<< (outconvertclass &theoutc, displayclass &display)
-{
-  display.setconvertclass (&theoutc);
-  return display;
-}
-
-displayclass &operator<< (displayclass &display, const text_t &t)
-{
-  outconvertclass *theoutc = display.getconvertclass();
-
-  if (theoutc == NULL) return display;
-  
-  text_t output;
-  display.expandstring (t, output);
-  (*theoutc) << output;
-
-  return display;
-}
Index: unk/gsdl/src/library/display.h
===================================================================
--- /trunk/gsdl/src/library/display.h	(revision 10)
+++ 	(revision )
@@ -1,229 +1,0 @@
-/**************************************************************************
- *
- * display.h
- *
- * This is an implementation of a macro language that is context 
- * sensitive. It is used to generate pages which have different
- * 'versions'. Many variants of a macro are possible, macro
- * resolution is done at expansion time by finding the best
- * macro for the 'situation'.
- *
- * This implementation relies heavily on the Standard Template
- * Library.
- *
- * Copyright (c) 1998 -- Rodger McNab and Hong Chen
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- *
- * $Id$
- *
- **************************************************************************/
-
-
-#ifndef DISPLAY_H
-#define DISPLAY_H
-
-#include "text_t.h"
-
-
-#ifndef USE_OBJECTSPACE
-#  include <vector>
-#  include <list>
-#  include <set>
-#  include <map>
-#  include <algorithm>
-#else
-#  include <ospace\std\vector>
-#  include <ospace\std\list>
-#  include <ospace\std\set>
-#  include <ospace\std\map>
-#  include <ospace\std\algorithm>
-#endif
-
-// use the standard namespace
-#ifdef __GNUG__
-// namespaces are broken in current version of gcc
-#else
-#  ifndef USE_OBJECTSPACE
-using namespace std;
-#  else
-#    ifndef OS_NO_NAMESPACE
-using namespace ospace::std;
-#    endif
-#  endif
-#endif
-
-
-
-// MAXRECURSIONDEPTH is a cutoff to catch
-// cyclic macros (a includes b and b includes a)
-#define MAXRECURSIONDEPTH 30
-
-
-// class prototypes
-class defaultmacros_t;
-class currentmacros_t;
-
-// a few supporting types
-// fileelement isn't finished yet, I have to find out
-// more about getting information about files
-struct fileinfoelement 
-{
-  int otherinfo;
-};
-
-typedef map<text_t, fileinfoelement, lttext_t> fileinfomap;
-
-
-typedef map<text_t, text_t, lttext_t> paramhashtype;
-
-
-struct paramspec 
-{
-  double spec;
-  text_t param;
-};
-
-inline bool operator==(const paramspec& x, const paramspec& y) 
-{
-  return ((x.spec == y.spec) && (x.param == y.param));
-}
-
-inline bool operator!=(const paramspec& x, const paramspec& y) 
-{
-  return ((x.spec != y.spec) || (x.param != y.param));
-}
-
-// note: paramspec is sorted by reverse spec and then param
-
-inline bool operator<(const paramspec& x, const paramspec& y) 
-{
-  return ((x.spec > y.spec) ||
-	  ((x.spec == y.spec) && (x.param < y.param)));
-}
-
-inline bool operator>(const paramspec& x, const paramspec& y) 
-{
-  return ((x.spec < y.spec) ||
-	  ((x.spec == y.spec) && (x.param > y.param)));
-}
-
-typedef vector<paramspec> paramspeclist;
-
-
-// NOTE: when macros are used within text they should have
-// underscores '_' on both sides, however, in calls to
-// setdefaultmacro and setmacro they should not have the
-// underscores. So you might have
-//
-// setmacro ("aname", "query", " some text ");
-// expandstring ("_aname_", expandedtext);
-//
-// because the input to expandstring is a block of text, not
-// a macroname
-
-class displayclass 
-{
-public:
-  displayclass ();
-  ~displayclass ();
-  
-  // setdefaultmacro adds an entry to the list of default macros 
-  // returns 0 if there was no error,
-  //        -1 if it redefined a macro
-  //        -2 if it hid a Global macro
-  //        -3 if it redefined a macro and hid a Global macro
-  //        -4 if no macroname was supplied
-  int setdefaultmacro (text_t package, const text_t &macroname, 
-		       text_t params, const text_t &macrovalue);
-  
-  // loads a default macro file (if it isn't already loaded)
-  // returns 0 if didn't need to load the file (it was already loaded)
-  //         1 if was (re)loaded
-  //        -1 an error occurred while trying to load the file
-  int loaddefaultmacros (text_t thisfilename);
-  
-  // prepares to create a page: deletes all macros set with
-  // 'setmacro', checks all the default macro files to see
-  // if any need reloading, and sets the page parameters.
-  void openpage (const text_t &thispageparams, 
-		 const text_t &thisprecedence);
-  
-  // changes the parameters for the current page.
-  void setpageparams (text_t thispageparams, 
-		      text_t thisprecedence);
-  
-  // overrides (or sets) a macro for the current page.
-  // returns 0 if there was no error,
-  //        -1 if it redefined a macro
-  //        -4 if no macroname was supplied
-  int setmacro (const text_t &macroname, 
-		text_t package, 
-		const text_t &macrovalue);
-  
-  void expandstring (const text_t &inputtext, text_t &outputtext);
-  void expandstring (text_t package, const text_t &inputtext,
-		     text_t &outputtext, int recursiondepth = 0);
-
-  // these functions are not ment to be used directly, they are used to permit 
-  // concise stream output like:
-  // cout << text_t2ascii << display << "_amacro_" << "_anothermacro_";
-  void setconvertclass (outconvertclass *theoutc) {outc = theoutc;}
-  outconvertclass *getconvertclass () {return outc;}
-
-
-  // debug stuff
-  void printdefaultmacros ();
-  void printallparams ();
-
-protected:
-  // special variables to permit trickly output
-  outconvertclass *outc;
-
-  // general variables
-  text_tset allparams;  // possible parameter combinations
-  defaultmacros_t *defaultmacros;
-  fileinfomap *defaultfiles;
-  
-  // variables to do with a page expansion
-  text_t params;
-  text_t precedence;
-  paramspeclist *orderparamlist; // ordered by specificness
-  currentmacros_t *currentmacros; // only macros set by setmacro
-  
-  // reloads any default macro files which have changed
-  // returns 0 no errors occurred
-  //        -1 an error occurred while trying to load one of the files
-  int checkdefaultmacrofiles ();
-
-  int setdefaultmacro (text_t package, const text_t &macroname, 
-		       text_t params, const text_t &filename,
-		       const text_t &macrovalue); 
-
-  // (recursively) expand out a macro
-  // returns true  if the macro was found
-  //         false if the macro was not found
-  bool macro (const text_t &macroname, text_t macropackage, 
-	      const text_t &macroparam, text_t &outputtext,
-	      int recursiondepth);
-};
-
-
-displayclass &operator<< (outconvertclass &theoutc, displayclass &display);
-displayclass &operator<< (displayclass &display, const text_t &t);
-
-
-#endif
-
Index: unk/gsdl/src/library/text_t.cpp
===================================================================
--- /trunk/gsdl/src/library/text_t.cpp	(revision 10)
+++ 	(revision )
@@ -1,555 +1,0 @@
-/**************************************************************************
- *
- * text_t.cpp -- a simple 16-bit charater string class
- * Copyright (c) 1998 -- Rodger McNab
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- *
- * $Id$
- *
- **************************************************************************/
-
-/*
-   $Log$
-   Revision 1.1  1998/11/17 01:11:06  sjboddie
-   Initial revision
-
-   Revision 1.7  1998/06/24 01:50:08  rjmcnab
-   Added stuff for the objectspace libraries
-
-   Revision 1.6  1998/06/22 22:11:14  rjmcnab
-   Added copy operator = for ints and c-strings for efficiency
-   Added some general functions for dealing with text_ts
-
-   Revision 1.5  1998/06/18 23:53:52  rjmcnab
-   added '+' operator for concatenation
-   removed global declaration of ascii2text_t and text_t2ascii
-     (too unfriendly for threads)
-   added support for integers
-
-   Revision 1.4  1998/06/17 04:52:32  rjmcnab
-   added support for arrays of characters
-
-   Revision 1.3  1998/06/17 02:09:42  rjmcnab
-   added getcstr
-
-   Revision 1.2  1998/06/15 22:01:19  rjmcnab
-   fixed a few bugs
-
-   Revision 1.1  1998/06/13 20:08:34  rjmcnab
-   Initial revision
-
-*/
-
-static char *RCSID = "$Id$";
-
-
-#ifndef USE_OBJECTSPACE
-#  include <algorithm>
-#else
-#  include <ospace\std\algorithm>
-#endif
-
-
-#include "text_t.h"
-
-////////////////////////////////////
-// text_t methods
-////////////////////////////////////
-
-text_t::text_t () 
-{
-  clear ();
-}
-
-text_t::text_t (int i) 
-{
-  clear ();
-  appendint (i);
-}
-
-text_t::text_t (char *s) 
-{
-  clear ();
-  appendcstr (s);
-}
-
-void text_t::append (const text_t &t) 
-{
-  const_iterator here, end=t.end();
-  for (here=t.begin(); here!=end;here++)
-    {
-      text.push_back(*here);
-    }
-}
-
-void text_t::appendrange (iterator first, iterator last) 
-{
-  while (first != last) 
-    {
-      text.push_back (*first);
-      first++;
-    }
-}
-
-void text_t::appendrange (const_iterator first, const_iterator last) 
-{
-  while (first != last) 
-    {
-      text.push_back (*first);
-      first++;
-    }
-}
-
-void text_t::appendint (int i)
-{
-  // deal with zeros and negatives
-  if (i == 0) 
-    {
-      text.push_back('0');
-      return;
-    }
-  else if (i < 0)
-    {
-      text.push_back('-');
-      i *= -1;
-    }
-
-  // get a buffer for the conversion
-  int maxbuflen = sizeof(int)*3;
-  char *buf = new char[maxbuflen];
-  int len = 0;
-  
-  // get the number in reverse
-  while (i > 0)
-    {
-      buf[len++] = '0'+ (i%10);
-      i = i/10;
-    }
-
-  // reverse the number
-  while (len > 0)
-    {
-      text.push_back(buf[--len]);
-    }
-
-  delete buf;
-}
-
-int text_t::getint ()
-{
-  int i = 0;
-  int mult = 1; // become -1 for negative numbers
-
-  iterator here = text.begin();
-  iterator end = text.end();
-  
-  // do plus and minus signs
-  if (here != end)
-    {
-      if (*here == '-')
-	{
-	  mult = -1;
-	  here++;
-	}
-      else if (*here == '+')
-	{
-	  mult = 1;
-	  here++;
-	}
-    }
-
-  // deal with the number
-  while ((here != end) && (*here >= '0') && (*here <= '9'))
-    {
-      i = 10*i + (*here - '0');
-      here++;
-    }
-
-  i *= mult;
-  return i;
-}
-
-
-
-void text_t::appendcarr (char *s, size_type len)
-{
-  unsigned char *us = (unsigned char *)s;
-  while (len > 0) 
-    {
-      text.push_back (*us); // append this character
-      us++;
-      len--;
-    }
-}
-
-void text_t::appendcstr (char *s) 
-{
-  unsigned char *us = (unsigned char *)s;
-  while (*us != '\0') 
-    {
-      text.push_back (*us); // append this character
-      us++;
-    }
-}
-
-
-// strings returned from getcarr and getcstr become the callers 
-// responsibility and should be deallocated with "delete"
-
-char *text_t::getcarr(size_type &len) const
-{
-  unsigned char *cstr = new unsigned char[size()];
-  const_iterator ithere = begin();
-  const_iterator itend = end();
-
-  while (ithere != itend)
-    {
-      if (*ithere >= 256) cstr[len] = ' ';
-      else cstr[len] = (*ithere);
-      len++;
-      ithere++;
-    }
-
-  return (char *)cstr;
-}
-
-char *text_t::getcstr() const
-{
-  unsigned char *cstr = new unsigned char[size() + 1];
-  const_iterator ithere = begin();
-  const_iterator itend = end();
-  int len = 0;
-
-  while (ithere != itend)
-    {
-      if (*ithere >= 256) cstr[len] = ' ';
-      else cstr[len] = (*ithere);
-      len++;
-      ithere++;
-    }
-
-  cstr[len] = '\0';
-
-  return (char *)cstr;
-}
-
-
-// general functions which work on text_ts
-
-// find a character within a range
-text_t::const_iterator findchar (text_t::const_iterator first, text_t::const_iterator last, 
-				 unsigned short c)
-{
-  while (first != last)
-    {
-      if (*first == c) break;
-      first++;
-    }
-  return first;
-}
-
-text_t::iterator findchar (text_t::iterator first, text_t::iterator last, 
-			   unsigned short c)
-{
-  while (first != last)
-    {
-      if (*first == c) break;
-      first++;
-    }
-  return first;
-}
-
-// get a string up to the next delimiter (which is skipped)
-text_t::const_iterator getdelimitstr (text_t::const_iterator first, 
-				      text_t::const_iterator last,
-				      unsigned short c, text_t &outstr)
-{
-  text_t::const_iterator here = first;
-  here = findchar (first, last, c);
-  outstr.clear();
-  outstr.appendrange (first, here);
-  if (here != last) here++; // skip c
-  return here;
-}
-
-text_t::iterator getdelimitstr (text_t::iterator first, text_t::iterator last,
-				unsigned short c, text_t &outstr)
-{
-  text_t::iterator here = first;
-  here = findchar (first, last, c);
-  outstr.clear();
-  outstr.appendrange (first, here);
-  if (here != last) here++; // skip c
-  return here;
-}
-
-// split a string with a character
-void splitchar (text_t::const_iterator first, text_t::const_iterator last,
-		unsigned short c, text_tlist &outlist)
-{
-  outlist.erase(outlist.begin(), outlist.end());
-
-  text_t t;
-
-  while (first != last)
-    {
-      first = getdelimitstr (first, last, c, t);
-      outlist.push_back (t);
-    }
-}
-
-void splitchar (text_t::const_iterator first, text_t::const_iterator last,
-		unsigned short c, text_tarray &outlist)
-{
-  outlist.erase(outlist.begin(), outlist.end());
-
-  text_t t;
-
-  while (first != last)
-    {
-      first = getdelimitstr (first, last, c, t);
-      outlist.push_back (t);
-    }
-}
-
-// join a string using a character
-void joinchar (const text_tlist &inlist, unsigned short c, text_t &outtext)
-{
-  outtext.clear ();
-
-  text_tlist::const_iterator here = inlist.begin ();
-  text_tlist::const_iterator end = inlist.end ();
-  bool first = true;
-  while (here != end)
-    {
-      if (!first) outtext.push_back (c);
-      first = false;
-      outtext += *here;
-      here++;
-    }
-}
-
-void joinchar (const text_tarray &inlist, unsigned short c, text_t &outtext)
-{
-  outtext.clear ();
-
-  text_tarray::const_iterator here = inlist.begin ();
-  text_tarray::const_iterator end = inlist.end ();
-  bool first = true;
-  while (here != end)
-    {
-      if (!first) outtext.push_back (c);
-      first = false;
-      outtext += *here;
-      here++;
-    }
-}
-
-// count the occurances of a character within a range
-int countchar (text_t::const_iterator first, text_t::const_iterator last,
-	       unsigned short c)
-{
-  int count = 0;
-  while (first != last) {
-    if (*first == c) count ++;
-    first ++;
-  }
-  return count;
-}
-
-
-
-////////////////////////////////////
-// convertclass methods
-////////////////////////////////////
-
-// conversion classes used for getting information in to and out of
-// the text_t class.
-
-convertclass::convertclass () 
-{
-  // nothing to do
-}
-
-void convertclass::reset ()
-{
-  // nothing to do
-}
-
-
-////////////////////////////////////
-// inconvertclass methods
-////////////////////////////////////
-
-// convert from a char stream to the text_t class
-// the default version assumes the input is a ascii
-// character array
-
-inconvertclass::inconvertclass () 
-{
-  start = NULL;
-  len = 0;
-}
-
-
-void inconvertclass::reset ()
-{
-  start = NULL;
-  len = 0;
-}
-
-void inconvertclass::setinput (char *thestart, size_t thelen)
-{
-  start = thestart;
-  len = thelen;
-}
-
-void inconvertclass::convert (text_t &output, status_t &status)
-{
-  if (start == NULL || len == 0)
-    {
-      status = finished;
-      return;
-    }
-
-  // don't want any funny sign conversions happening
-  unsigned char *here = (unsigned char *)start;
-  while (len > 0) 
-    {
-      output.push_back (*here); // append this character
-      ++here;
-      --len;
-    }
-
-  start = (char *)here; // save current position
-  status = finished;
-}
-
-// an instance of the default inconvertclass to do simple
-// conversions. Note that any functions that use this are
-// not reentrant. If a function needs to be reentrant it
-// should declare its own instance.
-inconvertclass ascii2text_t;
-
-
-////////////////////////////////////
-// outconvertclass methods
-////////////////////////////////////
-
-// Convert from a text_t class to a char stream
-// This default version assumes the output is a ascii
-// character array. If you set the output stream you
-// can use this class to output to a stream using the
-// << operator. The << operator can also be conveniently
-// used to set the output stream by doing something like
-//
-// cout << text_t2ascii << text_tstr << anothertext_tstr;
-//
-outconvertclass::outconvertclass ()
-{
-  input = NULL;
-  outs = NULL;
-}
-
-void outconvertclass::reset ()
-{
-  input = NULL;
-  outs = NULL;
-}
-
-void outconvertclass::setinput (text_t *theinput)
-{
-  input = theinput;
-  if (input != NULL) texthere = input->begin();
-}
-
-void outconvertclass::convert (char *output, size_t maxlen, 
-		      size_t &len, status_t &status)
-{
-  if (input == NULL || output == NULL)
-    {
-      status = finished;
-      return;
-    }
-
-  // don't want any funny sign conversions happening
-  unsigned char *uoutput = (unsigned char *)output;
-  text_t::iterator textend = input->end();
-  len = 0;
-  while ((len < maxlen) && (texthere != textend)) 
-    {
-      if (*texthere < 256) *uoutput = (unsigned char)(*texthere);
-      else *uoutput = 32; // put a space where a char >= 256 exists
-      ++uoutput;
-      ++len;
-      ++texthere;
-    }
-  
-  if (texthere == textend) status = finished;
-  else status = unfinished;
-}
-
-void outconvertclass::setostream (ostream *theouts)
-{
-  outs = theouts;
-}
-
-ostream *outconvertclass::getostream ()
-{
-  return outs;
-}
-
-
-
-
-// an instance of the default outconvertclass to do simple
-// conversions
-outconvertclass text_t2ascii;
-
-
-
-// stream operators for the output class
-
-outconvertclass &operator<< (ostream &theouts, outconvertclass &outconverter)
-{
-  outconverter.setostream(&theouts);
-  return outconverter;
-}
-
-
-#define STREAMBUFSIZE 256
-outconvertclass &operator<< (outconvertclass &outconverter, const text_t &t)
-{
-  ostream *outstream = outconverter.getostream();
-
-  if (outstream == NULL) return outconverter;
-
-  char outbuf[STREAMBUFSIZE];
-  size_t len;
-  outconvertclass::status_t status = outconvertclass::unfinished;
-
-  // assume that there is no data needing converting
-  // left in the converter
-  outconverter.setinput ((text_t *)(&t)); // note the const -> nonconst conversion
-
-  while (status == outconvertclass::unfinished)
-    {
-      outconverter.convert (outbuf, STREAMBUFSIZE, len, status);
-      if (len > 0) outstream->write(outbuf, len);
-    }
-
-  return outconverter;
-}
Index: unk/gsdl/src/library/text_t.h
===================================================================
--- /trunk/gsdl/src/library/text_t.h	(revision 10)
+++ 	(revision )
@@ -1,313 +1,0 @@
-/**************************************************************************
- *
- * text_t.h -- a simple 16-bit charater string class
- * Copyright (c) 1998 -- Rodger McNab
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- *
- * $Id$
- *
- **************************************************************************/
-
-
-
-#ifndef TEXT_T_H
-#define TEXT_T_H
-
-#ifndef USE_OBJECTSPACE
-#  include <vector>
-#  include <list>
-#  include <set>
-#else
-#  include <ospace\std\vector>
-#  include <ospace\std\list>
-#  include <ospace\std\set>
-#endif
-
-// use the standard namespace
-#ifdef __GNUG__
-// namespaces are broken in current version of gcc
-#else
-#  ifndef USE_OBJECTSPACE
-using namespace std;
-#  else
-#    ifndef OS_NO_NAMESPACE
-using namespace ospace::std;
-#    endif
-#  endif
-#endif
-
-
-// class prototypes
-class inconvertclass;
-class outconvertclass;
-
-
-typedef vector<unsigned short> usvector;
-
-// The class text_t can handle long strings which may contain
-// null characters. It uses unsigned shorts to represent up to
-// 64K character values.
-class text_t {
-  public:
-  //type support for ucvector
-  typedef usvector::iterator iterator;
-  typedef usvector::const_iterator const_iterator;
-  typedef usvector::reference reference;
-  typedef usvector::const_reference const_reference;
-  typedef usvector::size_type size_type;
-  typedef usvector::difference_type difference_type;
-  typedef usvector::const_reverse_iterator const_reverse_iterator;
-  typedef usvector::reverse_iterator reverse_iterator;
-  
-protected:
-  usvector text;
-  
-public:
-  // constructors
-  text_t ();
-  text_t (int i);
-  text_t (char *s); // assumed to be a normal c string
-
-  // basic container support
-  iterator begin () {return text.begin();}
-  const_iterator begin () const {return text.begin();}
-  iterator end () {return text.end();}
-  const_iterator end () const {return text.end();}
-
-  void erase(iterator pos) {text.erase(pos);}
-  void erase(iterator first, iterator last) {text.erase(first, last);}
-  void push_back(unsigned short c) {text.push_back(c);}
-  void pop_back() {text.pop_back();}
-  text_t &operator=(const text_t &x) {text=x.text;return *this;}
-  reference operator[](size_type n) {return text[n];};
-  const_reference operator[](size_type n) const {return text[n];};
-
-  bool empty () const {return text.empty();}
-  size_type size() const {return text.size();}
-  friend bool operator!=(const text_t& x, const text_t& y);
-  friend bool operator==(const text_t& x, const text_t& y);
-  friend bool operator<(const text_t& x, const text_t& y);
-  friend bool operator>(const text_t& x, const text_t& y);
-  
-  // added functionality
-  void clear () {text.erase(text.begin(),text.end());}
-  void append (const text_t &t);
-  void appendrange (iterator first, iterator last);
-  void appendrange (const_iterator first, const_iterator last);
-  text_t &operator+= (const text_t &t) {append(t);return *this;}
-
-  // support for integers
-  void appendint (int i);
-  void setint (int i) {clear();appendint(i);}
-  text_t &operator=(int i) {setint (i);return *this;}
-  text_t &operator+= (int i) {appendint(i);return *this;}
-  int getint ();
-
-  // support for arrays of chars
-  void appendcarr (char *s, size_type len);
-  void setcarr (char *s, size_type len) {clear();appendcarr(s,len);}
-
-  // support for null-terminated C strings
-  void appendcstr (char *s);
-  void setcstr (char *s) {clear();appendcstr(s);}
-  text_t &operator= (char *s) {setcstr(s);return *this;} // c string
-  text_t &operator+= (char *s) {appendcstr(s);return *this;} // c string
-
-  // strings returned from getcarr and getcstr become the callers 
-  // responsibility and should be deallocated with "delete"
-  char *getcarr(size_type &len) const;
-  char *getcstr() const;
-};
-
-
-inline text_t operator+(const text_t &t1, const text_t &t2)
-{
-  text_t tnew = t1;
-  tnew.append(t2);
-  return tnew;
-}
-
-inline text_t operator+(const text_t &t1, int i1)
-{
-  text_t tnew = t1;
-  tnew.appendint(i1);
-  return tnew;
-}
-
-inline text_t operator+(const text_t &t1, char *s1)
-{
-  text_t tnew = t1;
-  tnew.appendcstr(s1);
-  return tnew;
-}
-
-
-inline bool operator!=(const text_t& x, const text_t& y) 
-{
-  return (x.text != y.text);
-}
-
-inline bool operator==(const text_t& x, const text_t& y) 
-{
-  return (x.text == y.text);
-}
-
-inline bool operator<(const text_t& x, const text_t& y) 
-{
-  return (x.text < y.text);
-}
-
-inline bool operator>(const text_t& x, const text_t& y) 
-{
-  return (x.text > y.text);
-}
-
-
-struct eqtext_t 
-{
-  bool operator()(const text_t t1, const text_t t2) const
-  { return t1 == t2; }
-};
-
-struct lttext_t 
-{
-  bool operator()(const text_t t1, const text_t t2) const
-  { return t1 < t2; }
-};
-
-
-// frequently used derived types
-typedef set<text_t,lttext_t> text_tset;
-typedef list<text_t> text_tlist;  // more efficient for insertions/deletions
-typedef vector<text_t> text_tarray; // more space efficient than text_tlist
-
-
-// general functions which work on text_ts
-
-// find a character within a range
-text_t::const_iterator findchar (text_t::const_iterator first, text_t::const_iterator last, 
-				 unsigned short c);
-text_t::iterator findchar (text_t::iterator first, text_t::iterator last, 
-			   unsigned short c);
-
-// get a string up to the next delimiter (which is skipped)
-text_t::const_iterator getdelimitstr (text_t::const_iterator first, 
-				      text_t::const_iterator last,
-				      unsigned short c, text_t &outstr);
-text_t::iterator getdelimitstr (text_t::iterator first, text_t::iterator last,
-				unsigned short c, text_t &outstr);
-
-// split a string with a character
-void splitchar (text_t::const_iterator first, text_t::const_iterator last,
-		unsigned short c, text_tlist &outlist);
-void splitchar (text_t::const_iterator first, text_t::const_iterator last,
-		unsigned short c, text_tarray &outlist);
-
-// join a string using a character
-void joinchar (const text_tlist &inlist, unsigned short c, text_t &outtext);
-void joinchar (const text_tarray &inlist, unsigned short c, text_t &outtext);
-
-// count the occurances of a character within a range
-int countchar (text_t::const_iterator first, text_t::const_iterator last,
-	       unsigned short c);
-
-
-
-
-
-
-
-
-// conversion classes used for getting information in to and out of
-// the text_t class.
-
-class convertclass 
-{
-public:
-  enum status_t {finished, stopped, unfinished};
-  
-  convertclass ();
-  virtual void reset ();
-};
-
-
-
-// convert from a char stream to the text_t class
-// the default version assumes the input is a ascii
-// character array
-class inconvertclass : public convertclass
-{
-public:
-  inconvertclass ();
-  void reset ();
-  void setinput (char *thestart, size_t thelen);
-  virtual void convert (text_t &output, status_t &status);
-
-protected:
-  char *start;
-  size_t len;
-};
-
-// to get something which will do the conversion
-// to ascii declare a (non global!) instance like
-// this
-// inconvertclass ascii2text_t;
-
-
-// Convert from a text_t class to a char stream
-// This default version assumes the output is a ascii
-// character array. If you set the output stream you
-// can use this class to output to a stream using the
-// << operator. The << operator can also be conveniently
-// used to set the output stream by doing something like
-//
-// cout << text_t2ascii << textstr << anothertextstr;
-//
-// this class assumes that the input text doesn't change
-// while the conversion takes place
-class outconvertclass : public convertclass
-{
-public:
-  outconvertclass ();
-  void reset ();
-  void setinput (text_t *theinput);
-  // note that convert does not null-terminate the
-  // output array of characters
-  virtual void convert (char *output, size_t maxlen, 
-			size_t &len, status_t &status);
-
-  void setostream (ostream *theouts);
-  ostream *getostream ();
-
-protected:
-  text_t *input;
-  text_t::iterator texthere; // only valid if input is valid
-
-  ostream *outs;
-};
-
-// to get something which will do the conversion
-// to text_t declare a (non global!) instance like
-// this
-// outconvertclass text_t2ascii;
-
-
-// stream operators for the output class
-outconvertclass &operator<< (ostream &theouts, outconvertclass &outconverter);
-outconvertclass &operator<< (outconvertclass &outconverter, const text_t &t);
-
-
-#endif
