Index: trunk/psLib/src/sys/psMemory.c
===================================================================
--- trunk/psLib/src/sys/psMemory.c	(revision 1440)
+++ 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;
     }
