Index: /trunk/psLib/src/sys/psString.c
===================================================================
--- /trunk/psLib/src/sys/psString.c	(revision 6200)
+++ /trunk/psLib/src/sys/psString.c	(revision 6201)
@@ -11,7 +11,8 @@
  *
  *  @author Eric Van Alst, MHPCC
- *
- *  @version $Revision: 1.21 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2005-11-22 19:11:07 $
+ *  @author David Robbins, MHPCC
+ *
+ *  @version $Revision: 1.22 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2006-01-26 05:31:54 $
  *
  *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
@@ -35,5 +36,6 @@
 }
 
-psString psStringNCopy(const char *string, unsigned int nChar)
+psString psStringNCopy(const char *string,
+                       unsigned int nChar)
 {
     char *returnValue = NULL;
@@ -59,5 +61,7 @@
 }
 
-ssize_t psStringAppend(char **dest, const char *format, ...)
+ssize_t psStringAppend(char **dest,
+                       const char *format,
+                       ...)
 {
     va_list         args;
@@ -104,5 +108,7 @@
 }
 
-ssize_t psStringPrepend(char **dest, const char *format, ...)
+ssize_t psStringPrepend(char **dest,
+                        const char *format,
+                        ...)
 {
     va_list         args;
@@ -157,2 +163,41 @@
     return length;
 }
+
+// XXX: This should probably be implemented using strpbrk
+psList *psStringSplit(const char *string,
+                      const char *splitters)
+{
+    psList *values = psListAlloc(NULL); // The list of values to return
+    unsigned int length = strlen(string); // The length of the string
+    unsigned int numSplitters = strlen(splitters); // Number of characters that might split
+    unsigned int start = 0;             // The position of the start of a word
+    for (int i = 1; i < length; i++) {
+        bool split = false;             // Is this character a splitter?
+        for (int j = 0; j < numSplitters && ! split; j++) {
+            if (string[i] == splitters[j]) {
+                split = true;
+            }
+        }
+        if (split) {
+            if (i == start) {
+                // Some idiot put in two spaces, or two commas or something
+                start++;
+            } else {
+                // We're at the end of the word
+                psString word = psStringNCopy(&string[start], i - start);
+                (void)psListAdd(values, PS_LIST_TAIL, word);
+                start = i + 1;
+                psFree(word);
+            }
+        }
+    }
+    if (start < length) {
+        // Copy the last word
+        psString word = psStringNCopy(&string[start], length - start);
+        (void)psListAdd(values, PS_LIST_TAIL, word);
+        psFree(word);
+    }
+
+    return values;
+}
+
Index: /trunk/psLib/src/sys/psString.h
===================================================================
--- /trunk/psLib/src/sys/psString.h	(revision 6200)
+++ /trunk/psLib/src/sys/psString.h	(revision 6201)
@@ -12,7 +12,8 @@
  *
  *  @author Eric Van Alst, MHPCC
+ *  @author David Robbins, MHPCC
  *
- *  @version $Revision: 1.16 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2005-09-13 01:09:58 $
+ *  @version $Revision: 1.17 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2006-01-26 05:31:54 $
  *
  *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
@@ -24,4 +25,5 @@
 #include <sys/types.h>
 #include "psType.h"
+#include "psList.h"
 
 /** This macro will convert the argument to a quoted string */
@@ -40,5 +42,4 @@
  *
  *  @return psString:      Copy of input string
- *
  */
 psString psStringCopy(
@@ -57,9 +58,5 @@
  *
  *  @return  psString:   Copy of input string
- *
  */
-
-/*@null@*/
-
 psString psStringNCopy(
     const char *string,                ///< Input string of characters to copy
@@ -72,7 +69,6 @@
  * automatically extended to the size of the new string.
  *
- * @return The length of the new string (excluding '\0')
+ * @return ssize_t:     The length of the new string (excluding '\0')
  */
-
 ssize_t psStringAppend(
     char **dest,                        ///< existing string
@@ -86,7 +82,6 @@
  * automatically extended to the size of the new string.
  *
- * @return The length of the new string (excluding '\0')
+ * @return ssize_t:     The length of the new string (excluding '\0')
  */
-
 ssize_t psStringPrepend(
     char **dest,                        ///< existing string
@@ -95,4 +90,16 @@
 );
 
+/** Procedure to split the input string into a psList of psStrings.
+ *
+ *  The string is split at any one of the characters in splitters.  Split
+ *  strings of zero length should not be included in the output list.
+ *
+ *  @return psList*:    The list of (split) psStrings.
+ */
+psList *psStringSplit(
+    const char *string,
+    const char *splitters
+);
+
 /** @} */// Doxygen - End of SystemGroup Functions
 
Index: /trunk/psLib/test/types/verified/tst_psMetadata_07.stderr
===================================================================
--- /trunk/psLib/test/types/verified/tst_psMetadata_07.stderr	(revision 6200)
+++ /trunk/psLib/test/types/verified/tst_psMetadata_07.stderr	(revision 6201)
@@ -57,4 +57,6 @@
 \**********************************************************************************/
 
+<DATE><TIME>|<HOST>|I|testMetaCopy
+    Following should generate error message
 <DATE><TIME>|<HOST>|E|psMetadataCopy (FILE:LINENO)
     Unallowable operation: in is NULL.
