Index: trunk/psLib/src/sys/psString.c
===================================================================
--- trunk/psLib/src/sys/psString.c	(revision 6500)
+++ trunk/psLib/src/sys/psString.c	(revision 6874)
@@ -13,6 +13,6 @@
  *  @author David Robbins, MHPCC
  *
- *  @version $Revision: 1.24 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2006-02-01 20:40:56 $
+ *  @version $Revision: 1.25 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2006-04-17 22:00:03 $
  *
  *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
@@ -214,2 +214,43 @@
 }
 
+// given the input string, search for all copies of the key, and replace with the replacement value
+// the input string may be freed if not needed
+char *psStringSubstitute (char *input, char *replace, char *key)
+{
+
+    char *p;
+
+    if (key == NULL)
+        return input;
+    if (strlen(key) == 0)
+        return input;
+
+    while (true) {
+        p = strstr (input, key);
+        if (p == NULL)
+            return input;
+
+        // we have input = xxxkeyxxx
+        // we want output = xxxreplacexxx
+
+        // this is safe since we will subtract strlen(key) elements from input
+        char *output = psAlloc(strlen(input) + strlen(replace) + 1);
+        int Nc = p - input;
+
+        // copy the first segement into 'output'
+        strncpy (output, input, Nc);
+
+        // copy the key replacement to the start of the key
+
+        strcpy (&output[Nc], replace);
+        Nc += strlen (replace);
+
+        // copy the remainder to the end of the replacement
+        strcpy (&output[Nc], p + strlen(key));
+
+        psFree (input);
+        input = output;
+    }
+    return input;
+}
+
Index: trunk/psLib/src/sys/psString.h
===================================================================
--- trunk/psLib/src/sys/psString.h	(revision 6500)
+++ trunk/psLib/src/sys/psString.h	(revision 6874)
@@ -14,6 +14,6 @@
  *  @author David Robbins, MHPCC
  *
- *  @version $Revision: 1.18 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2006-02-01 20:40:56 $
+ *  @version $Revision: 1.19 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2006-04-17 22:00:03 $
  *
  *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
@@ -103,4 +103,12 @@
 );
 
+// given the input string, search for all copies of the key, and replace with the replacement value
+// the input string may be freed if not needed
+char *psStringSubstitute (
+    char *input,    ///< input string to be modified
+    char *replace,    ///< replacement value
+    char *key    ///< string to be replaced in input
+);
+
 /** @} */// Doxygen - End of SystemGroup Functions
 
Index: trunk/psLib/src/sys/psType.h
===================================================================
--- trunk/psLib/src/sys/psType.h	(revision 6500)
+++ trunk/psLib/src/sys/psType.h	(revision 6874)
@@ -10,6 +10,6 @@
 *  @author Ross Harman, MHPCC
 *
-*  @version $Revision: 1.46 $ $Name: not supported by cvs2svn $
-*  @date $Date: 2006-02-08 00:00:35 $
+*  @version $Revision: 1.47 $ $Name: not supported by cvs2svn $
+*  @date $Date: 2006-04-17 22:00:03 $
 *
 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
@@ -130,4 +130,5 @@
     PS_DATA_POLYNOMIAL4D,              ///< psPolynomial4D
     PS_DATA_PROJECTION,                ///< psProjection
+    PS_DATA_REGION,                    ///< psRegion
     PS_DATA_SCALAR,                    ///< psScalar
     PS_DATA_SPHERE,                    ///< psSphere
