Index: trunk/psLib/src/sysUtils/psError.c
===================================================================
--- trunk/psLib/src/sysUtils/psError.c	(revision 2228)
+++ trunk/psLib/src/sysUtils/psError.c	(revision 2273)
@@ -10,6 +10,6 @@
  *  @author Eric Van Alst, MHPCC
  *   
- *  @version $Revision: 1.18 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2004-10-27 00:57:31 $
+ *  @version $Revision: 1.19 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2004-11-04 01:05:00 $
  *
  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -67,43 +67,17 @@
 }
 
-void psError(const char *name, const char *fmt, ...)
+psErrorCode p_psError(const char* file,
+                      int lineno,
+                      const char* func,
+                      psErrorCode code,
+                      psBool new,
+                      const char* fmt,
+                      ...)
 {
-    va_list argPtr;             // variable list arguement pointer
+    char errMsg[2048];
+    psErr* err;
+    char msgName[256];
 
-    // Get the variable list parameters to pass to logging function
-    va_start(argPtr, fmt);
-
-    // Call logging function with PS_LOG_ERROR level
-    psLogMsgV(name, PS_LOG_ERROR, fmt, argPtr);
-
-    // Clean up stack after variable argument has been used
-    va_end(argPtr);
-}
-
-void psErrorClear()
-{
-    pthread_mutex_lock(&lockErrorStack);
-    for (psS32 lcv=0;lcv<errorStackSize;lcv++) {
-        p_psMemSetPersistent(errorStack[lcv]->msg,false);
-        p_psMemSetPersistent(errorStack[lcv]->name,false);
-        p_psMemSetPersistent(errorStack[lcv],false);
-        psFree(errorStack[lcv]);
-    }
-    errorStackSize = 0;
-    pthread_mutex_unlock(&lockErrorStack);
-}
-
-psErrorCode psErrorMsg(const char *name, psErrorCode code, psBool new, const char* fmt, ...)
-{
-    char errMsg[1024];
-    psErr* err;
-    char* msgName;
-
-    // Check for null pointer and if found set to empty string;
-    if ( name == NULL ) {
-        msgName = "";
-    } else {
-        msgName = (char*)name;
-    }
+    snprintf(msgName,256,"%s (%s:%d)",func,file,lineno);
 
     va_list argPtr;             // variable list arguement pointer
@@ -116,5 +90,5 @@
     va_start(argPtr, fmt);
 
-    vsnprintf(errMsg,1024,fmt,argPtr);
+    vsnprintf(errMsg,2048,fmt,argPtr);
     err = psErrAlloc(msgName,code,errMsg);
     pushErrorStack(err);
@@ -160,4 +134,19 @@
 }
 
+void psErrorClear(void)
+{
+    pthread_mutex_lock(&lockErrorStack);
+
+    for (int lcv=0;lcv < errorStackSize; lcv++) {
+        p_psMemSetPersistent(errorStack[lcv],false);
+        p_psMemSetPersistent(errorStack[lcv]->msg,false);
+        p_psMemSetPersistent(errorStack[lcv]->name,false);
+        psFree(errorStack[lcv]);
+    }
+    errorStackSize = 0;
+
+    pthread_mutex_unlock(&lockErrorStack);
+
+}
 void psErrorStackPrint(FILE *fd, const char *fmt, ...)
 {
Index: trunk/psLib/src/sysUtils/psError.h
===================================================================
--- trunk/psLib/src/sysUtils/psError.h	(revision 2228)
+++ trunk/psLib/src/sysUtils/psError.h	(revision 2273)
@@ -12,6 +12,6 @@
  *  @author Eric Van Alst, MHPCC
  *
- *  @version $Revision: 1.14 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2004-10-27 00:57:31 $
+ *  @version $Revision: 1.15 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2004-11-04 01:05:00 $
  *
  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -104,25 +104,19 @@
  *  log message.
  *
+ *  This function modifies the error stack.
+ *
+ *  @return psErrorCode    the given error code
  */
-void psError(
-    const char *name,                  ///< Source of error such as file or function detected
-    const char *fmt,                   ///< A printf style formatting statement defining msg
+psErrorCode p_psError(
+    const char* file,
+    int lineno,
+    const char* func,
+    psErrorCode code,                  ///< Error class code
+    psBool new,                        ///< true if error originates at this location
+    const char* fmt,
     ...
 );
 
-/** Reports an error message to the logging facility
- *
- *  This function will invoke the psLogMsg function with a level of
- *  PS_LOG_ERROR and pass the parameters name and fmt to generate a proper
- *  log message.
- *
- */
-psErrorCode psErrorMsg(
-    const char *name,                  ///< Name of error in the form aaa.bbb.ccc
-    psErrorCode code,                  ///< Error class code
-    psBool new,                          ///< true if error originates at this location
-    const char* fmt,                   ///< printf style formatting statement defining error message
-    ...
-);
+#define psError(code,new,...) p_psError(__FILE__,__LINE__,__func__,code,new,__VA_ARGS__)
 
 /** Create a new psErr struct
Index: trunk/psLib/src/sysUtils/psErrorCodes.c
===================================================================
--- trunk/psLib/src/sysUtils/psErrorCodes.c	(revision 2228)
+++ trunk/psLib/src/sysUtils/psErrorCodes.c	(revision 2273)
@@ -7,6 +7,6 @@
  *  @author Robert DeSonia, MHPCC
  *
- *  @version $Revision: 1.11 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2004-10-27 00:57:31 $
+ *  @version $Revision: 1.12 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2004-11-04 01:05:00 $
  *
  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -46,5 +46,6 @@
             {PS_ERR_BAD_PARAMETER_NULL,"parameter is null"},
             {PS_ERR_BAD_PARAMETER_SIZE,"size of parameter's data is outside of acceptable range."},
-            {PS_ERR_UNEXPECTED_NULL,"unexpected NULL foun"},
+            {PS_ERR_UNEXPECTED_NULL,"unexpected NULL found"},
+            {PS_ERR_OS_CALL_FAILED,"unexpected result from an OS standard library call"},
             //~End
             {PS_ERR_N_ERR_CLASSES,"error classes end marker"}
@@ -132,7 +133,6 @@
 
     if (errors == NULL) {
-        psErrorMsg(PS_ERRORNAME_DOMAIN "psErrorRegister",
-                   PS_ERR_BAD_PARAMETER_NULL, true,
-                   PS_ERRORTEXT_psErrorCode_NULL_ERRORDESCRIPTION);
+        psError(PS_ERR_BAD_PARAMETER_NULL, true,
+                PS_ERRORTEXT_psErrorCode_NULL_ERRORDESCRIPTION);
         return;
     }
@@ -152,8 +152,7 @@
                         err) ) {
 
-            psErrorMsg(PS_ERRORNAME_DOMAIN "psErrorRegister",
-                       PS_ERR_UNKNOWN, false,
-                       PS_ERRORTEXT_psErrorCode_ERRORCODE_REGISTER_FAILED,
-                       i);
+            psError(PS_ERR_UNKNOWN, false,
+                    PS_ERRORTEXT_psErrorCode_ERRORCODE_REGISTER_FAILED,
+                    i);
         }
         p_psMemSetPersistent(dynamicErrorCodes->head,true);
Index: trunk/psLib/src/sysUtils/psErrorCodes.h
===================================================================
--- trunk/psLib/src/sysUtils/psErrorCodes.h	(revision 2228)
+++ trunk/psLib/src/sysUtils/psErrorCodes.h	(revision 2273)
@@ -7,6 +7,6 @@
  *  @author Robert DeSonia, MHPCC
  *
- *  @version $Revision: 1.12 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2004-10-27 00:57:31 $
+ *  @version $Revision: 1.13 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2004-11-04 01:05:00 $
  *
  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -52,5 +52,6 @@
     PS_ERR_BAD_PARAMETER_NULL,   ///< parameter is null
     PS_ERR_BAD_PARAMETER_SIZE,   ///< size of parameter's data is outside of acceptable range.
-    PS_ERR_UNEXPECTED_NULL,   ///< unexpected NULL foun
+    PS_ERR_UNEXPECTED_NULL,   ///< unexpected NULL found
+    PS_ERR_OS_CALL_FAILED,   ///< unexpected result from an OS standard library call
     //~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 2228)
+++ trunk/psLib/src/sysUtils/psLogMsg.c	(revision 2273)
@@ -11,6 +11,6 @@
  *  @author George Gusciora, MHPCC
  *
- *  @version $Revision: 1.34 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2004-10-27 00:57:31 $
+ *  @version $Revision: 1.35 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2004-11-04 01:05:00 $
  *
  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -110,7 +110,7 @@
 
     if (sscanf(dest, "%4s:%256s", protocol, location) < 2) {
-        psErrorMsg(PS_ERRORNAME_DOMAIN "psLogSetDestination", true, PS_ERR_LOCATION_INVALID,
-                   PS_ERRORTEXT_psLogMsg_DESTINATION_MALFORMED,
-                   dest);
+        psError(PS_ERR_LOCATION_INVALID, true,
+                PS_ERRORTEXT_psLogMsg_DESTINATION_MALFORMED,
+                dest);
         return false;
     }
@@ -131,7 +131,7 @@
             return true;
         }
-        psErrorMsg(PS_ERRORNAME_DOMAIN "psLogSetDestination", true, PS_ERR_LOCATION_INVALID,
-                   PS_ERRORTEXT_psLogMsg_DEST_LOCATION_INVALID,
-                   location);
+        psError(PS_ERR_LOCATION_INVALID, true,
+                PS_ERRORTEXT_psLogMsg_DEST_LOCATION_INVALID,
+                location);
         return 1;
     } else if (strcmp(protocol, "file") == 0) {
@@ -139,7 +139,7 @@
 
         if (file == NULL) {
-            psErrorMsg(PS_ERRORNAME_DOMAIN "psLogSetDestination", true, PS_ERR_IO,
-                       PS_ERRORTEXT_psLogMsg_OPEN_FILE_FAILED,
-                       location);
+            psError(PS_ERR_IO, true,
+                    PS_ERRORTEXT_psLogMsg_OPEN_FILE_FAILED,
+                    location);
             return false;
         }
@@ -151,7 +151,7 @@
     }
 
-    psErrorMsg(PS_ERRORNAME_DOMAIN "psLogSetDestination", true, PS_ERR_LOCATION_INVALID,
-               PS_ERRORTEXT_psLogMsg_UNSUPPORTED_PROTOCOL,
-               protocol);
+    psError(PS_ERR_LOCATION_INVALID, true,
+            PS_ERRORTEXT_psLogMsg_UNSUPPORTED_PROTOCOL,
+            protocol);
     return false;
 }
@@ -215,6 +215,6 @@
             break;
         default:
-            psErrorMsg(PS_ERRORNAME_DOMAIN "psLogSetFormat", true, PS_ERR_BAD_PARAMETER_VALUE,
-                       PS_ERRORTEXT_psLogMsg_UNKNOWN_KEY, *ptr);
+            psError(PS_ERR_BAD_PARAMETER_VALUE, true,
+                    PS_ERRORTEXT_psLogMsg_UNKNOWN_KEY, *ptr);
             break;
         }
Index: trunk/psLib/src/sysUtils/psMemory.c
===================================================================
--- trunk/psLib/src/sysUtils/psMemory.c	(revision 2228)
+++ trunk/psLib/src/sysUtils/psMemory.c	(revision 2273)
@@ -8,6 +8,6 @@
 *  @author Robert Lupton, Princeton University
 *
-*  @version $Revision: 1.43 $ $Name: not supported by cvs2svn $
-*  @date $Date: 2004-10-27 19:35:59 $
+*  @version $Revision: 1.44 $ $Name: not supported by cvs2svn $
+*  @date $Date: 2004-11-04 01:05:00 $
 *
 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -100,7 +100,7 @@
 {
     if (ptr->refCounter < 1) {
-        psErrorMsg(PS_ERRORNAME_DOMAIN "memProblemCallbackDefault", false, PS_ERR_MEMORY_CORRUPTION,
-                   PS_ERRORTEXT_psMemory_MULTIPLE_FREE,
-                   ptr->id, ptr->file, ptr->lineno, file, lineno);
+        psError(PS_ERR_MEMORY_CORRUPTION, false,
+                PS_ERRORTEXT_psMemory_MULTIPLE_FREE,
+                ptr->id, ptr->file, ptr->lineno, file, lineno);
     }
 
@@ -228,6 +228,6 @@
 
     if (m == NULL) {
-        psErrorMsg(PS_ERRORNAME_DOMAIN "checkMemBlock", true, PS_ERR_MEMORY_CORRUPTION,
-                   PS_ERRORTEXT_psMemory_NULL_BLOCK);
+        psError(PS_ERR_MEMORY_CORRUPTION, true,
+                PS_ERRORTEXT_psMemory_NULL_BLOCK);
         return 1;
     }
@@ -235,20 +235,20 @@
     if (m->refCounter == 0) {
         // using an unreferenced block of memory, are you?
-        psErrorMsg(PS_ERRORNAME_DOMAIN "checkMemBlock", true, PS_ERR_MEMORY_CORRUPTION,
-                   PS_ERRORTEXT_psMemory_DEREF_BLOCK_USE,
-                   m->id);
+        psError(PS_ERR_MEMORY_CORRUPTION, true,
+                PS_ERRORTEXT_psMemory_DEREF_BLOCK_USE,
+                m->id);
         return 1;
     }
 
     if (m->startblock != P_PS_MEMMAGIC || m->endblock != P_PS_MEMMAGIC) {
-        psErrorMsg(PS_ERRORNAME_DOMAIN "checkMemBlock", true, PS_ERR_MEMORY_CORRUPTION,
-                   PS_ERRORTEXT_psMemory_UNDERFLOW,
-                   m->id);
+        psError(PS_ERR_MEMORY_CORRUPTION, true,
+                PS_ERRORTEXT_psMemory_UNDERFLOW,
+                m->id);
         return 1;
     }
     if (*(psPtr *)((int8_t *) (m + 1) + m->userMemorySize) != P_PS_MEMMAGIC) {
-        psErrorMsg(PS_ERRORNAME_DOMAIN "checkMemBlock", true, PS_ERR_MEMORY_CORRUPTION,
-                   PS_ERRORTEXT_psMemory_OVERFLOW,
-                   m->id);
+        psError(PS_ERR_MEMORY_CORRUPTION, true,
+                PS_ERRORTEXT_psMemory_OVERFLOW,
+                m->id);
         return 1;
     }
@@ -431,7 +431,7 @@
         psMemBlock* ptr = ((psMemBlock* ) vptr) - 1;
 
-        psErrorMsg(PS_ERRORNAME_DOMAIN "psFree",PS_ERR_MEMORY_DEREF_USAGE,true,
-                   PS_ERRORTEXT_psMemory_MULTIPLE_FREE,
-                   ptr->id, ptr->file, ptr->lineno, file, lineno);
+        psError(PS_ERR_MEMORY_DEREF_USAGE,true,
+                PS_ERRORTEXT_psMemory_MULTIPLE_FREE,
+                ptr->id, ptr->file, ptr->lineno, file, lineno);
 
         return;
Index: trunk/psLib/src/sysUtils/psString.c
===================================================================
--- trunk/psLib/src/sysUtils/psString.c	(revision 2228)
+++ trunk/psLib/src/sysUtils/psString.c	(revision 2273)
@@ -9,6 +9,6 @@
  *  @author Eric Van Alst, MHPCC
  *
- *  @version $Revision: 1.13 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2004-10-27 00:57:31 $
+ *  @version $Revision: 1.14 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2004-11-04 01:05:00 $
  *
  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -38,7 +38,7 @@
     if (nChar < 0) {
         // Log error message and return NULL
-        psErrorMsg(PS_ERRORNAME_DOMAIN "psStringNCopy", PS_ERR_BAD_PARAMETER_VALUE, true,
-                   PS_ERRORTEXT_psString_NCHAR_NEGATIVE,
-                   nChar);
+        psError(PS_ERR_BAD_PARAMETER_VALUE, true,
+                PS_ERRORTEXT_psString_NCHAR_NEGATIVE,
+                nChar);
         return NULL;
     }
Index: trunk/psLib/src/sysUtils/psTrace.c
===================================================================
--- trunk/psLib/src/sysUtils/psTrace.c	(revision 2228)
+++ trunk/psLib/src/sysUtils/psTrace.c	(revision 2273)
@@ -9,6 +9,6 @@
  *  @author George Gusciora, MHPCC
  *
- *  @version $Revision: 1.37 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2004-10-27 23:31:44 $
+ *  @version $Revision: 1.38 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2004-11-04 01:05:00 $
  *
  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -161,6 +161,6 @@
     // XXX: Verify that this is the correct behavior.
     if (strcmp("", addNodeName) == 0) {
-        psErrorMsg(PS_ERRORNAME_DOMAIN "componentAdd",PS_ERR_BAD_PARAMETER_NULL,true,
-                   PS_ERRORTEXT_psTrace_ADD_NULL_COMPONENT);
+        psError(PS_ERR_BAD_PARAMETER_NULL,true,
+                PS_ERRORTEXT_psTrace_ADD_NULL_COMPONENT);
         return false;
     }
@@ -173,7 +173,7 @@
 
     if (addNodeName[0] != '.') {
-        psErrorMsg(PS_ERRORNAME_DOMAIN "componentAdd",PS_ERR_BAD_PARAMETER_VALUE,true,
-                   PS_ERRORTEXT_psTrace_MALFORMED_COMPONENT_NAME,
-                   addNodeName);
+        psError(PS_ERR_BAD_PARAMETER_VALUE,true,
+                PS_ERRORTEXT_psTrace_MALFORMED_COMPONENT_NAME,
+                addNodeName);
         return false;
     }
@@ -262,10 +262,8 @@
     // Add the new component to the component tree.
     if ( !componentAdd(compName, level) ) {
-        psErrorMsg(PS_ERRORNAME_DOMAIN "psTraceSetLevel",
-                   PS_ERR_UNKNOWN,
-                   false,
-                   PS_ERRORTEXT_psTrace_FAILED_TO_ADD_COMPONENT,
-                   level,
-                   compName);
+        psError(PS_ERR_UNKNOWN, false,
+                PS_ERRORTEXT_psTrace_FAILED_TO_ADD_COMPONENT,
+                level,
+                compName);
 
         if (comp[0] != '.') {
@@ -482,7 +480,7 @@
 
     if (NULL == comp) {
-        psErrorMsg(PS_ERRORNAME_DOMAIN "psTrace", PS_ERR_BAD_PARAMETER_NULL, true,
-                   PS_ERRORTEXT_psTrace_NULL_TRACETREE,
-                   __func__);
+        psError(PS_ERR_BAD_PARAMETER_NULL, true,
+                PS_ERRORTEXT_psTrace_NULL_TRACETREE,
+                __func__);
         return;
     }
