Index: /trunk/psLib/src/sys/psAbort.c
===================================================================
--- /trunk/psLib/src/sys/psAbort.c	(revision 1695)
+++ /trunk/psLib/src/sys/psAbort.c	(revision 1696)
@@ -10,65 +10,14 @@
  *  @author Eric Van Alst, MHPCC
  *   
- *  @version $Revision: 1.8 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2004-08-07 00:06:06 $
+ *  @version $Revision: 1.9 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2004-09-07 19:05:07 $
  *
  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
  */
 
-/******************************************************************************/
-
-/*  INCLUDE FILES                                                             */
-
-/******************************************************************************/
 #include <stdarg.h>
 #include <stdlib.h>
 #include "psAbort.h"
 #include "psLogMsg.h"
-
-/******************************************************************************/
-
-/*  DEFINE STATEMENTS                                                         */
-
-/******************************************************************************/
-
-// None
-
-/******************************************************************************/
-
-/*  TYPE DEFINITIONS                                                          */
-
-/******************************************************************************/
-
-// None
-
-/*****************************************************************************/
-
-/*  GLOBAL VARIABLES                                                         */
-
-/*****************************************************************************/
-
-// None
-
-/*****************************************************************************/
-
-/*  FILE STATIC VARIABLES                                                    */
-
-/*****************************************************************************/
-
-// None
-
-/*****************************************************************************/
-
-/*  FUNCTION IMPLEMENTATION - LOCAL                                          */
-
-/*****************************************************************************/
-
-// None
-
-/*****************************************************************************/
-
-/* FUNCTION IMPLEMENTATION - PUBLIC                                          */
-
-/*****************************************************************************/
 
 void psAbort(const char *name, const char *fmt, ...)
Index: /trunk/psLib/src/sys/psError.c
===================================================================
--- /trunk/psLib/src/sys/psError.c	(revision 1695)
+++ /trunk/psLib/src/sys/psError.c	(revision 1696)
@@ -1,3 +1,2 @@
-
 /** @file  psError.c
  *
@@ -11,6 +10,6 @@
  *  @author Eric Van Alst, MHPCC
  *   
- *  @version $Revision: 1.11 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2004-09-03 20:39:50 $
+ *  @version $Revision: 1.12 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2004-09-07 19:05:07 $
  *
  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
Index: /trunk/psLib/src/sys/psErrorCodes.c
===================================================================
--- /trunk/psLib/src/sys/psErrorCodes.c	(revision 1695)
+++ /trunk/psLib/src/sys/psErrorCodes.c	(revision 1696)
@@ -7,6 +7,6 @@
  *  @author Robert DeSonia, MHPCC
  *
- *  @version $Revision: 1.1 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2004-09-02 22:23:20 $
+ *  @version $Revision: 1.2 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2004-09-07 19:05:07 $
  *
  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -21,7 +21,7 @@
  * the other lines by, for each error class in psErrorCodes.dat, the following
  * substitutions are made:
- *     $ErrorCode        The error code name (first word in the psErrorCodes.dat lines)
- *     $ErrorDescription The error description (rest of the line in psErrorCodes.dat)
- *     $ErrorNumber      The order of the source line in psErrorCodes.dat (comments excluded)
+ *     $1  The error code name (first word in the psErrorCodes.dat lines)
+ *     $2  The error description (rest of the line in psErrorCodes.dat)
+ *     $n  The order of the source line in psErrorCodes.dat (comments excluded)
  * 
  * DO NOT EDIT THE LINES BETWEEN //~Start and //~End!  ANY CHANGES WILL BE OVERWRITTEN.
@@ -31,8 +31,12 @@
             {PS_ERR_NONE,"not an error"},
             {PS_ERR_BASE,"base error"},
-            //~Start    {PS_ERR_$ErrorCode,"$ErrorDescription"},
+            //~Start    {PS_ERR_$1,"$2"},
             {PS_ERR_UNKNOWN,"unknown error"},
             {PS_ERR_IO,"I/O error"},
             {PS_ERR_MEMORY_CORRUPTION,"memory corruption detected"},
+            {PS_ERR_MEMORY_DEREF_USAGE,"dereferenced memory still used"},
+            {PS_ERR_LOCATION_INVALID,"specified location is unknown"},
+            {PS_ERR_BAD_VALUE,"value is out-of-range"},
+            {PS_ERR_BAD_LENGTH,"string value is too lon"},
             //~End
             {PS_ERR_N_ERR_CLASSES,"error classes end marker"}
Index: /trunk/psLib/src/sys/psErrorCodes.h
===================================================================
--- /trunk/psLib/src/sys/psErrorCodes.h	(revision 1695)
+++ /trunk/psLib/src/sys/psErrorCodes.h	(revision 1696)
@@ -7,6 +7,6 @@
  *  @author Robert DeSonia, MHPCC
  *
- *  @version $Revision: 1.3 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2004-09-02 22:23:20 $
+ *  @version $Revision: 1.4 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2004-09-07 19:05:07 $
  *
  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -20,7 +20,7 @@
  * the other lines by, for each error class in psErrorCodes.dat, the following
  * substitutions are made:
- *     $ErrorCode        The error code name (first word in the psErrorCodes.dat lines)
- *     $ErrorDescription The error description (rest of the line in psErrorCodes.dat)
- *     $ErrorNumber      The order of the source line in psErrorCodes.dat (comments excluded)
+ *     $1  The error code name (first word in the psErrorCodes.dat lines)
+ *     $2  The error description (rest of the line in psErrorCodes.dat)
+ *     $n  The order of the source line in psErrorCodes.dat (comments excluded)
  * 
  * DO NOT EDIT THE LINES BETWEEN //~Start and //~End!  ANY CHANGES WILL BE OVERWRITTEN.
@@ -40,8 +40,12 @@
      */
 
-    //~Start     PS_ERR_$ErrorCode, ///< $ErrorDescription
-    PS_ERR_UNKNOWN, ///< unknown error
-    PS_ERR_IO, ///< I/O error
-    PS_ERR_MEMORY_CORRUPTION, ///< memory corruption detected
+    //~Start     PS_ERR_$1,   ///< $2
+    PS_ERR_UNKNOWN,   ///< unknown error
+    PS_ERR_IO,   ///< I/O error
+    PS_ERR_MEMORY_CORRUPTION,   ///< memory corruption detected
+    PS_ERR_MEMORY_DEREF_USAGE,   ///< dereferenced memory still used
+    PS_ERR_LOCATION_INVALID,   ///< specified location is unknown
+    PS_ERR_BAD_VALUE,   ///< value is out-of-range
+    PS_ERR_BAD_LENGTH,   ///< string value is too lon
     //~End
     PS_ERR_N_ERR_CLASSES               ///< end marker - should not be used as a true error
Index: /trunk/psLib/src/sys/psLogMsg.c
===================================================================
--- /trunk/psLib/src/sys/psLogMsg.c	(revision 1695)
+++ /trunk/psLib/src/sys/psLogMsg.c	(revision 1696)
@@ -12,6 +12,6 @@
  *  @author George Gusciora, MHPCC
  *
- *  @version $Revision: 1.26 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2004-08-10 01:55:34 $
+ *  @version $Revision: 1.27 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2004-09-07 19:05:07 $
  *
  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -41,8 +41,13 @@
 #include "psTrace.h"
 
+#include "psSysUtilsErrors.h"
+#define ERRORNAME_PREFIX PS_ERRORNAME_DOMAIN ".psLogMsg."
+
 #define MIN_LOG_LEVEL 0
 #define MAX_LOG_LEVEL 9
 
 #define MAX_LOG_LINE_LENGTH 128
+
+
 static FILE *logDest = (FILE *) 1;      // flag to initialize to stderr before using.
 static int globalLogLevel = PS_LOG_INFO;        // log all messages at this or above
@@ -108,5 +113,7 @@
 
     if (sscanf(dest, "%4s:%256s", protocol, location) < 2) {
-        psError(__func__, "The specified destination, %s, is malformed.", dest);
+        psErrorMsg(ERRORNAME_PREFIX "psLogSetDestination", true, PS_ERR_LOCATION_INVALID,
+                   PS_ERRORTEXT_psLogSetDestination_DESTINATION_MALFORMED,
+                   dest);
         return false;
     }
@@ -127,5 +134,7 @@
             return true;
         }
-        psError(__func__, "The location, %s, for protocol 'dest' is invalid.", location);
+        psErrorMsg(ERRORNAME_PREFIX "psLogSetDestination", true, PS_ERR_LOCATION_INVALID,
+                   PS_ERRORTEXT_psLogSetDestination_DEST_LOCATION_INVALID,
+                   location);
         return 1;
     } else if (strcmp(protocol, "file") == 0) {
@@ -133,5 +142,7 @@
 
         if (file == NULL) {
-            psError(__func__, "Could not open file '%s' for output.", location);
+            psErrorMsg(ERRORNAME_PREFIX "psLogSetDestination", true, PS_ERR_IO,
+                       PS_ERRORTEXT_psLogSetDestination_OPEN_FILE_FAILED,
+                       location);
             return false;
         }
@@ -143,5 +154,7 @@
     }
 
-    psError(__func__, "Do not know how to handle the protocol '%s'.", protocol);
+    psErrorMsg(ERRORNAME_PREFIX "psLogSetDestination", true, PS_ERR_LOCATION_INVALID,
+               PS_ERRORTEXT_psLogSetDestination_UNSUPPORTED_PROTOCOL,
+               protocol);
     return false;
 }
@@ -205,5 +218,6 @@
             break;
         default:
-            psError(__func__, "Unknown logging keyword %c", *ptr);
+            psErrorMsg(ERRORNAME_PREFIX "psLogSetFormat", true, PS_ERR_BAD_VALUE,
+                       PS_ERRORTEXT_psLogSetFormat_UNKNOWN_KEY, *ptr);
             break;
         }
Index: /trunk/psLib/src/sys/psMemory.c
===================================================================
--- /trunk/psLib/src/sys/psMemory.c	(revision 1695)
+++ /trunk/psLib/src/sys/psMemory.c	(revision 1696)
@@ -9,6 +9,6 @@
 *  @author Robert Lupton, Princeton University
 *
-*  @version $Revision: 1.34 $ $Name: not supported by cvs2svn $
-*  @date $Date: 2004-08-09 23:34:58 $
+*  @version $Revision: 1.35 $ $Name: not supported by cvs2svn $
+*  @date $Date: 2004-09-07 19:05:07 $
 *
 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -27,4 +27,7 @@
 #include "psLogMsg.h"
 
+#include "psSysUtilsErrors.h"
+#define ERRORNAME_PREFIX PS_ERRORNAME_DOMAIN ".psMemory."
+
 #define P_PS_MEMMAGIC (void *)0xdeadbeef   // Magic number in psMemBlock header
 
@@ -100,7 +103,7 @@
 {
     if (ptr->refCounter < 1) {
-        psError(__func__,
-                "Block %ld allocated at %s:%d freed more than once at %s:%d\n",
-                ptr->id, ptr->file, ptr->lineno, file, lineno);
+        psErrorMsg(ERRORNAME_PREFIX "memProblemCallbackDefault", false, PS_ERR_MEMORY_CORRUPTION,
+                   PS_ERRORTEXT_memProblemCallbackDefault_MULTIPLE_FREE,
+                   ptr->id, ptr->file, ptr->lineno, file, lineno);
     }
 
@@ -228,5 +231,6 @@
 
     if (m == NULL) {
-        psError(funcName, "Memory Corruption: NULL memory block found.");
+        psErrorMsg(ERRORNAME_PREFIX "checkMemBlock", true, PS_ERR_MEMORY_CORRUPTION,
+                   PS_ERRORTEXT_checkMemBlock_NULL_BLOCK);
         return 1;
     }
@@ -234,14 +238,20 @@
     if (m->refCounter == 0) {
         // using an unreferenced block of memory, are you?
-        psError(__func__, "Memory Corruption: memory block %ld was freed but still used.", m->id);
+        psErrorMsg(ERRORNAME_PREFIX "checkMemBlock", true, PS_ERR_MEMORY_CORRUPTION,
+                   PS_ERRORTEXT_checkMemBlock_DEREF_USE,
+                   m->id);
         return 1;
     }
 
     if (m->startblock != P_PS_MEMMAGIC || m->endblock != P_PS_MEMMAGIC) {
-        psError(funcName, "Memory Corruption: memory block %ld is corrupted (buffer underflow)", m->id);
+        psErrorMsg(ERRORNAME_PREFIX "checkMemBlock", true, PS_ERR_MEMORY_CORRUPTION,
+                   PS_ERRORTEXT_checkMemBlock_UNDERFLOW,
+                   m->id);
         return 1;
     }
     if (*(void **)((int8_t *) (m + 1) + m->userMemorySize) != P_PS_MEMMAGIC) {
-        psError(funcName, "Memory Corruption: memory block %ld is corrupted (buffer overflow)", m->id);
+        psErrorMsg(ERRORNAME_PREFIX "checkMemBlock", true, PS_ERR_MEMORY_CORRUPTION,
+                   PS_ERRORTEXT_checkMemBlock_OVERFLOW,
+                   m->id);
         return 1;
     }
Index: /trunk/psLib/src/sysUtils/Makefile
===================================================================
--- /trunk/psLib/src/sysUtils/Makefile	(revision 1695)
+++ /trunk/psLib/src/sysUtils/Makefile	(revision 1696)
@@ -3,6 +3,6 @@
 ##  Makefile:   sysUtils
 ##
-##  $Revision: 1.19 $  $Name: not supported by cvs2svn $
-##  $Date: 2004-09-02 22:23:20 $
+##  $Revision: 1.20 $  $Name: not supported by cvs2svn $
+##  $Date: 2004-09-07 19:05:07 $
 ##
 ##  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -40,4 +40,6 @@
 OBJS = $(addprefix makedir/,$(SRC_OBJS))
 
+HEADERS = $(SRC_OBJS:.o=.h) psType.h
+
 # Define PHONY target "all" which will make all the necessary items
 
@@ -49,4 +51,8 @@
 psErrorCodes.c: psErrorCodes.dat
 	perl parseErrorCodes.pl --data=$? $@
+
+psSysUtilsErrors.h: psSysUtilsErrors.dat
+	perl parseErrorCodes.pl --data=$? $@
+
 
 # Rule to make static library
@@ -60,5 +66,5 @@
 
 install: $(TARGET_STATIC) 
-	install *.h $(includedir)
+	install $(HEADERS) $(includedir)
 
 # Define PHONY target "distclean" which will cleanup the distribution
Index: /trunk/psLib/src/sysUtils/parseErrorCodes.pl
===================================================================
--- /trunk/psLib/src/sysUtils/parseErrorCodes.pl	(revision 1695)
+++ /trunk/psLib/src/sysUtils/parseErrorCodes.pl	(revision 1696)
@@ -63,7 +63,7 @@
             for ( $n = 0 ; $n < $found ; $n++ ) {
                 $_ = $line;
-                s/\$ErrorCode/$ErrorCodes[$n]/g;
-                s/\$ErrorDescription/$ErrorDescriptions[$n]/g;
-                s/\$ErrorNumber/$n/g;
+                s/\$1/$ErrorCodes[$n]/g;
+                s/\$2/$ErrorDescriptions[$n]/g;
+                s/\$n/$n/g;
                 push( @result, $_ );
                 print "$_\n" if $verbose;
Index: /trunk/psLib/src/sysUtils/psAbort.c
===================================================================
--- /trunk/psLib/src/sysUtils/psAbort.c	(revision 1695)
+++ /trunk/psLib/src/sysUtils/psAbort.c	(revision 1696)
@@ -10,65 +10,14 @@
  *  @author Eric Van Alst, MHPCC
  *   
- *  @version $Revision: 1.8 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2004-08-07 00:06:06 $
+ *  @version $Revision: 1.9 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2004-09-07 19:05:07 $
  *
  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
  */
 
-/******************************************************************************/
-
-/*  INCLUDE FILES                                                             */
-
-/******************************************************************************/
 #include <stdarg.h>
 #include <stdlib.h>
 #include "psAbort.h"
 #include "psLogMsg.h"
-
-/******************************************************************************/
-
-/*  DEFINE STATEMENTS                                                         */
-
-/******************************************************************************/
-
-// None
-
-/******************************************************************************/
-
-/*  TYPE DEFINITIONS                                                          */
-
-/******************************************************************************/
-
-// None
-
-/*****************************************************************************/
-
-/*  GLOBAL VARIABLES                                                         */
-
-/*****************************************************************************/
-
-// None
-
-/*****************************************************************************/
-
-/*  FILE STATIC VARIABLES                                                    */
-
-/*****************************************************************************/
-
-// None
-
-/*****************************************************************************/
-
-/*  FUNCTION IMPLEMENTATION - LOCAL                                          */
-
-/*****************************************************************************/
-
-// None
-
-/*****************************************************************************/
-
-/* FUNCTION IMPLEMENTATION - PUBLIC                                          */
-
-/*****************************************************************************/
 
 void psAbort(const char *name, const char *fmt, ...)
Index: /trunk/psLib/src/sysUtils/psError.c
===================================================================
--- /trunk/psLib/src/sysUtils/psError.c	(revision 1695)
+++ /trunk/psLib/src/sysUtils/psError.c	(revision 1696)
@@ -1,3 +1,2 @@
-
 /** @file  psError.c
  *
@@ -11,6 +10,6 @@
  *  @author Eric Van Alst, MHPCC
  *   
- *  @version $Revision: 1.11 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2004-09-03 20:39:50 $
+ *  @version $Revision: 1.12 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2004-09-07 19:05:07 $
  *
  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
Index: /trunk/psLib/src/sysUtils/psErrorCodes.c
===================================================================
--- /trunk/psLib/src/sysUtils/psErrorCodes.c	(revision 1695)
+++ /trunk/psLib/src/sysUtils/psErrorCodes.c	(revision 1696)
@@ -7,6 +7,6 @@
  *  @author Robert DeSonia, MHPCC
  *
- *  @version $Revision: 1.1 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2004-09-02 22:23:20 $
+ *  @version $Revision: 1.2 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2004-09-07 19:05:07 $
  *
  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -21,7 +21,7 @@
  * the other lines by, for each error class in psErrorCodes.dat, the following
  * substitutions are made:
- *     $ErrorCode        The error code name (first word in the psErrorCodes.dat lines)
- *     $ErrorDescription The error description (rest of the line in psErrorCodes.dat)
- *     $ErrorNumber      The order of the source line in psErrorCodes.dat (comments excluded)
+ *     $1  The error code name (first word in the psErrorCodes.dat lines)
+ *     $2  The error description (rest of the line in psErrorCodes.dat)
+ *     $n  The order of the source line in psErrorCodes.dat (comments excluded)
  * 
  * DO NOT EDIT THE LINES BETWEEN //~Start and //~End!  ANY CHANGES WILL BE OVERWRITTEN.
@@ -31,8 +31,12 @@
             {PS_ERR_NONE,"not an error"},
             {PS_ERR_BASE,"base error"},
-            //~Start    {PS_ERR_$ErrorCode,"$ErrorDescription"},
+            //~Start    {PS_ERR_$1,"$2"},
             {PS_ERR_UNKNOWN,"unknown error"},
             {PS_ERR_IO,"I/O error"},
             {PS_ERR_MEMORY_CORRUPTION,"memory corruption detected"},
+            {PS_ERR_MEMORY_DEREF_USAGE,"dereferenced memory still used"},
+            {PS_ERR_LOCATION_INVALID,"specified location is unknown"},
+            {PS_ERR_BAD_VALUE,"value is out-of-range"},
+            {PS_ERR_BAD_LENGTH,"string value is too lon"},
             //~End
             {PS_ERR_N_ERR_CLASSES,"error classes end marker"}
Index: /trunk/psLib/src/sysUtils/psErrorCodes.dat
===================================================================
--- /trunk/psLib/src/sysUtils/psErrorCodes.dat	(revision 1695)
+++ /trunk/psLib/src/sysUtils/psErrorCodes.dat	(revision 1696)
@@ -2,5 +2,14 @@
 #  This file is used to generate psErrorCode.h content
 #
-UNKNOWN                unknown error
-IO                     I/O error
-MEMORY_CORRUPTION      memory corruption detected
+# Format:
+#    ERROR_CLASS_NAME    ERROR_CLASS_DESCRIPTION
+#
+# Note: the ERROR_CLASS_NAME will appear in the code with a "PS_ERR_" prefix
+#
+UNKNOWN                        unknown error
+IO                             I/O error
+MEMORY_CORRUPTION              memory corruption detected
+MEMORY_DEREF_USAGE             dereferenced memory still used
+LOCATION_INVALID               specified location is unknown
+BAD_VALUE                      value is out-of-range
+BAD_LENGTH                     string value is too long
Index: /trunk/psLib/src/sysUtils/psErrorCodes.h
===================================================================
--- /trunk/psLib/src/sysUtils/psErrorCodes.h	(revision 1695)
+++ /trunk/psLib/src/sysUtils/psErrorCodes.h	(revision 1696)
@@ -7,6 +7,6 @@
  *  @author Robert DeSonia, MHPCC
  *
- *  @version $Revision: 1.3 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2004-09-02 22:23:20 $
+ *  @version $Revision: 1.4 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2004-09-07 19:05:07 $
  *
  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -20,7 +20,7 @@
  * the other lines by, for each error class in psErrorCodes.dat, the following
  * substitutions are made:
- *     $ErrorCode        The error code name (first word in the psErrorCodes.dat lines)
- *     $ErrorDescription The error description (rest of the line in psErrorCodes.dat)
- *     $ErrorNumber      The order of the source line in psErrorCodes.dat (comments excluded)
+ *     $1  The error code name (first word in the psErrorCodes.dat lines)
+ *     $2  The error description (rest of the line in psErrorCodes.dat)
+ *     $n  The order of the source line in psErrorCodes.dat (comments excluded)
  * 
  * DO NOT EDIT THE LINES BETWEEN //~Start and //~End!  ANY CHANGES WILL BE OVERWRITTEN.
@@ -40,8 +40,12 @@
      */
 
-    //~Start     PS_ERR_$ErrorCode, ///< $ErrorDescription
-    PS_ERR_UNKNOWN, ///< unknown error
-    PS_ERR_IO, ///< I/O error
-    PS_ERR_MEMORY_CORRUPTION, ///< memory corruption detected
+    //~Start     PS_ERR_$1,   ///< $2
+    PS_ERR_UNKNOWN,   ///< unknown error
+    PS_ERR_IO,   ///< I/O error
+    PS_ERR_MEMORY_CORRUPTION,   ///< memory corruption detected
+    PS_ERR_MEMORY_DEREF_USAGE,   ///< dereferenced memory still used
+    PS_ERR_LOCATION_INVALID,   ///< specified location is unknown
+    PS_ERR_BAD_VALUE,   ///< value is out-of-range
+    PS_ERR_BAD_LENGTH,   ///< string value is too lon
     //~End
     PS_ERR_N_ERR_CLASSES               ///< end marker - should not be used as a true error
Index: /trunk/psLib/src/sysUtils/psLogMsg.c
===================================================================
--- /trunk/psLib/src/sysUtils/psLogMsg.c	(revision 1695)
+++ /trunk/psLib/src/sysUtils/psLogMsg.c	(revision 1696)
@@ -12,6 +12,6 @@
  *  @author George Gusciora, MHPCC
  *
- *  @version $Revision: 1.26 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2004-08-10 01:55:34 $
+ *  @version $Revision: 1.27 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2004-09-07 19:05:07 $
  *
  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -41,8 +41,13 @@
 #include "psTrace.h"
 
+#include "psSysUtilsErrors.h"
+#define ERRORNAME_PREFIX PS_ERRORNAME_DOMAIN ".psLogMsg."
+
 #define MIN_LOG_LEVEL 0
 #define MAX_LOG_LEVEL 9
 
 #define MAX_LOG_LINE_LENGTH 128
+
+
 static FILE *logDest = (FILE *) 1;      // flag to initialize to stderr before using.
 static int globalLogLevel = PS_LOG_INFO;        // log all messages at this or above
@@ -108,5 +113,7 @@
 
     if (sscanf(dest, "%4s:%256s", protocol, location) < 2) {
-        psError(__func__, "The specified destination, %s, is malformed.", dest);
+        psErrorMsg(ERRORNAME_PREFIX "psLogSetDestination", true, PS_ERR_LOCATION_INVALID,
+                   PS_ERRORTEXT_psLogSetDestination_DESTINATION_MALFORMED,
+                   dest);
         return false;
     }
@@ -127,5 +134,7 @@
             return true;
         }
-        psError(__func__, "The location, %s, for protocol 'dest' is invalid.", location);
+        psErrorMsg(ERRORNAME_PREFIX "psLogSetDestination", true, PS_ERR_LOCATION_INVALID,
+                   PS_ERRORTEXT_psLogSetDestination_DEST_LOCATION_INVALID,
+                   location);
         return 1;
     } else if (strcmp(protocol, "file") == 0) {
@@ -133,5 +142,7 @@
 
         if (file == NULL) {
-            psError(__func__, "Could not open file '%s' for output.", location);
+            psErrorMsg(ERRORNAME_PREFIX "psLogSetDestination", true, PS_ERR_IO,
+                       PS_ERRORTEXT_psLogSetDestination_OPEN_FILE_FAILED,
+                       location);
             return false;
         }
@@ -143,5 +154,7 @@
     }
 
-    psError(__func__, "Do not know how to handle the protocol '%s'.", protocol);
+    psErrorMsg(ERRORNAME_PREFIX "psLogSetDestination", true, PS_ERR_LOCATION_INVALID,
+               PS_ERRORTEXT_psLogSetDestination_UNSUPPORTED_PROTOCOL,
+               protocol);
     return false;
 }
@@ -205,5 +218,6 @@
             break;
         default:
-            psError(__func__, "Unknown logging keyword %c", *ptr);
+            psErrorMsg(ERRORNAME_PREFIX "psLogSetFormat", true, PS_ERR_BAD_VALUE,
+                       PS_ERRORTEXT_psLogSetFormat_UNKNOWN_KEY, *ptr);
             break;
         }
Index: /trunk/psLib/src/sysUtils/psMemory.c
===================================================================
--- /trunk/psLib/src/sysUtils/psMemory.c	(revision 1695)
+++ /trunk/psLib/src/sysUtils/psMemory.c	(revision 1696)
@@ -9,6 +9,6 @@
 *  @author Robert Lupton, Princeton University
 *
-*  @version $Revision: 1.34 $ $Name: not supported by cvs2svn $
-*  @date $Date: 2004-08-09 23:34:58 $
+*  @version $Revision: 1.35 $ $Name: not supported by cvs2svn $
+*  @date $Date: 2004-09-07 19:05:07 $
 *
 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -27,4 +27,7 @@
 #include "psLogMsg.h"
 
+#include "psSysUtilsErrors.h"
+#define ERRORNAME_PREFIX PS_ERRORNAME_DOMAIN ".psMemory."
+
 #define P_PS_MEMMAGIC (void *)0xdeadbeef   // Magic number in psMemBlock header
 
@@ -100,7 +103,7 @@
 {
     if (ptr->refCounter < 1) {
-        psError(__func__,
-                "Block %ld allocated at %s:%d freed more than once at %s:%d\n",
-                ptr->id, ptr->file, ptr->lineno, file, lineno);
+        psErrorMsg(ERRORNAME_PREFIX "memProblemCallbackDefault", false, PS_ERR_MEMORY_CORRUPTION,
+                   PS_ERRORTEXT_memProblemCallbackDefault_MULTIPLE_FREE,
+                   ptr->id, ptr->file, ptr->lineno, file, lineno);
     }
 
@@ -228,5 +231,6 @@
 
     if (m == NULL) {
-        psError(funcName, "Memory Corruption: NULL memory block found.");
+        psErrorMsg(ERRORNAME_PREFIX "checkMemBlock", true, PS_ERR_MEMORY_CORRUPTION,
+                   PS_ERRORTEXT_checkMemBlock_NULL_BLOCK);
         return 1;
     }
@@ -234,14 +238,20 @@
     if (m->refCounter == 0) {
         // using an unreferenced block of memory, are you?
-        psError(__func__, "Memory Corruption: memory block %ld was freed but still used.", m->id);
+        psErrorMsg(ERRORNAME_PREFIX "checkMemBlock", true, PS_ERR_MEMORY_CORRUPTION,
+                   PS_ERRORTEXT_checkMemBlock_DEREF_USE,
+                   m->id);
         return 1;
     }
 
     if (m->startblock != P_PS_MEMMAGIC || m->endblock != P_PS_MEMMAGIC) {
-        psError(funcName, "Memory Corruption: memory block %ld is corrupted (buffer underflow)", m->id);
+        psErrorMsg(ERRORNAME_PREFIX "checkMemBlock", true, PS_ERR_MEMORY_CORRUPTION,
+                   PS_ERRORTEXT_checkMemBlock_UNDERFLOW,
+                   m->id);
         return 1;
     }
     if (*(void **)((int8_t *) (m + 1) + m->userMemorySize) != P_PS_MEMMAGIC) {
-        psError(funcName, "Memory Corruption: memory block %ld is corrupted (buffer overflow)", m->id);
+        psErrorMsg(ERRORNAME_PREFIX "checkMemBlock", true, PS_ERR_MEMORY_CORRUPTION,
+                   PS_ERRORTEXT_checkMemBlock_OVERFLOW,
+                   m->id);
         return 1;
     }
Index: /trunk/psLib/src/sysUtils/psSysUtilsErrors.dat
===================================================================
--- /trunk/psLib/src/sysUtils/psSysUtilsErrors.dat	(revision 1696)
+++ /trunk/psLib/src/sysUtils/psSysUtilsErrors.dat	(revision 1696)
@@ -0,0 +1,23 @@
+#
+#  This file is used to generate psSysUtilsErrors.h content
+#
+#  Format is:
+#  ERROR_NAME(one word)    ERROR_TEXT
+#
+####################################################################
+#
+# Error Messages from psLogMsg.c:
+#
+psLogSetDestination_DESTINATION_MALFORMED      The specified destination, %s, is malformed.
+psLogSetDestination_DEST_LOCATION_INVALID      The location, %s, for protocol 'dest' is invalid.
+psLogSetDestination_OPEN_FILE_FAILED           Could not open file '%s' for output.
+psLogSetDestination_UNSUPPORTED_PROTOCOL       Do not know how to handle the protocol '%s'.
+psLogSetFormat_UNKNOWN_KEY                     Unknown logging keyword %c.
+#
+# Error Messages from psMemory.c:
+#
+checkMemBlock_NULL_BLOCK                       NULL memory block found.
+checkMemBlock_DEREF_USE                        Memory block %ld was freed but still used.
+checkMemBlock_UNDERFLOW                        Memory block %ld is corrupted; buffer underflow detected.
+checkMemBlock_OVERFLOW                         Memory block %ld is corrupted; buffer overflow detected.
+memProblemCallbackDefault_MULTIPLE_FREE        Block %ld allocated at %s:%d freed more than once at %s:%d.
Index: /trunk/psLib/src/sysUtils/psSysUtilsErrors.h
===================================================================
--- /trunk/psLib/src/sysUtils/psSysUtilsErrors.h	(revision 1696)
+++ /trunk/psLib/src/sysUtils/psSysUtilsErrors.h	(revision 1696)
@@ -0,0 +1,44 @@
+/** @file  psSysUtilsErrors.h
+ *
+ *  @brief Contains the error text for the system utility functions
+ *
+ *  @ingroup ErrorHandling
+ *
+ *  @author Robert DeSonia, MHPCC
+ *
+ *  @version $Revision: 1.1 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2004-09-07 19:05:07 $
+ *
+ *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
+ */
+
+#ifndef PS_SYSUTILS_ERRORS_H
+#define PS_SYSUTILS_ERRORS_H
+
+/* N.B., lines between '//~Start' and '//~End' are automatic generated from
+ * the template following the '//~Start'.  The template is used to generate
+ * the other lines by, for each error text in psSysUtilsErrors.dat, the following
+ * substitutions are made:
+ *     $1  The error text macro name (first word in the psSysUtilsErrors.dat lines)
+ *     $2  The error text (rest of the line in psSysUtilsErrors.dat)
+ *     $n  The order of the source line in psSysUtilsErrors.dat (comments excluded)
+ * 
+ * DO NOT EDIT THE LINES BETWEEN //~Start and //~End!  ANY CHANGES WILL BE OVERWRITTEN.
+ */
+
+#define PS_ERRORNAME_DOMAIN "psLib.sysUtils"
+
+//~Start #define PS_ERRORTEXT_$1 "$2"
+#define PS_ERRORTEXT_psLogSetDestination_DESTINATION_MALFORMED "The specified destination, %s, is malformed."
+#define PS_ERRORTEXT_psLogSetDestination_DEST_LOCATION_INVALID "The location, %s, for protocol 'dest' is invalid."
+#define PS_ERRORTEXT_psLogSetDestination_OPEN_FILE_FAILED "Could not open file '%s' for output."
+#define PS_ERRORTEXT_psLogSetDestination_UNSUPPORTED_PROTOCOL "Do not know how to handle the protocol '%s'."
+#define PS_ERRORTEXT_psLogSetFormat_UNKNOWN_KEY "Unknown logging keyword %c."
+#define PS_ERRORTEXT_checkMemBlock_NULL_BLOCK "NULL memory block found."
+#define PS_ERRORTEXT_checkMemBlock_DEREF_USE "Memory block %ld was freed but still used."
+#define PS_ERRORTEXT_checkMemBlock_UNDERFLOW "Memory block %ld is corrupted; buffer underflow detected."
+#define PS_ERRORTEXT_checkMemBlock_OVERFLOW "Memory block %ld is corrupted; buffer overflow detected."
+#define PS_ERRORTEXT_memProblemCallbackDefault_MULTIPLE_FREE "Block %ld allocated at %s:%d freed more than once at %s:%d"
+//~End
+
+#endif
