Index: trunk/psLib/src/sys/psError.h
===================================================================
--- trunk/psLib/src/sys/psError.h	(revision 1683)
+++ trunk/psLib/src/sys/psError.h	(revision 1685)
@@ -12,6 +12,6 @@
  *  @author Eric Van Alst, MHPCC
  *
- *  @version $Revision: 1.9 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2004-09-02 22:23:20 $
+ *  @version $Revision: 1.10 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2004-09-03 20:39:50 $
  *
  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -22,4 +22,5 @@
 
 #include<stdio.h>
+#include<stdbool.h>
 
 #include "psErrorCodes.h"
@@ -29,18 +30,70 @@
  */
 
+/** Error message object */
 typedef struct
 {
-    char *name;                        ///< category of code that caused the error
+    char* name;                        ///< category of code that caused the error
     psErrorCode code;                  ///< class of error
-    char *msg;                         ///< the message associated with the error
+    char* msg;                         ///< the message associated with the error
 }
 psErr;
 
-const psErr *psErrorGet(int which);
-const psErr *psErrorLast(void);
+/** Get a error from the error stack
+ *
+ *  Previous errors on the stack are returned by psErrorGet (a value of 0 
+ *  passed to psErrorGet is equivalent to a call to psErrorLast).
+ *
+ *  if no error is at the which position, a non-NULL psErr is returned with 
+ *  code PS_ERR_NONE.
+ *
+ *  @return    Error message object at 'which'
+ */
+const psErr* psErrorGet(
+    int which                          ///< position in the error stack. 0 is last error on stack.
+);
+
+/** Get last error put on the error stack
+ *
+ *  The last error reported is available from psErrorLast; if no errors are 
+ *  current, a non-NULL psErr is returned with code PS_ERR_NONE.
+ *
+ *  @return psErr*     Reference to last error message on error stack
+ */
+const psErr* psErrorLast(void);
+
+/** Clears the error stack.
+ *
+ *  The error stack may be completely cleared with psErrorClear.
+ *
+ */
 void psErrorClear(void);
 
-void psErrorStackPrint(FILE *fd, const char *fmt, ...);
-void psErrorStackPrintV(FILE *fd, const char *fmt, va_list va);
+/** Prints error stack to specified open file descriptor
+ *
+ *  The entire error stack may be printed to an open file descriptor by 
+ *  calling psErrorStackPrint; if and only if there are current errors, the 
+ *  printf-style string fmt is first printed to the file descriptor fd. In 
+ *  this printout, error codes are replaced by their string equivalents.
+ *
+ */
+void psErrorStackPrint(
+    FILE* fd,                          ///< destination file descriptor
+    const char* fmt,                   ///< printf-style format of header line
+    ...                                ///< any parameters required in fmt
+);
+
+/** Prints error stack to specified open file descriptor
+ *
+ *  The entire error stack may be printed to an open file descriptor by 
+ *  calling psErrorStackPrintV; if and only if there are current errors, the 
+ *  vprintf-style string fmt is first printed to the file descriptor fd. In 
+ *  this printout, error codes are replaced by their string equivalents.
+ *
+ */
+void psErrorStackPrintV(
+    FILE* fd,                          ///< destination file descriptor
+    const char* fmt,                   ///< printf-style format of header line
+    va_list va                         ///< any parameters required in fmt
+);
 
 /** Reports an error message to the logging facility
@@ -57,4 +110,31 @@
 );
 
+/** 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.
+ *
+ */
+void psErrorMsg(
+    const char *name,                  ///< Name of error in the form aaa.bbb.ccc
+    psErrorCode code,                  ///< Error class code
+    bool new,                          ///< true if error originates at this location
+    const char* fmt,                   ///< printf style formatting statement defining error message
+    ...
+);
+
+/** Create a new psErr struct
+ *
+ *  Creates a new psErr struct, making a copy of the parameters.
+ *
+ *  @return psErr*     new psErr object
+ */
+psErr* psErrAlloc(
+    const char* name,                  ///< Name of error in the form aaa.bbb.ccc
+    psErrorCode code,                  ///< Error class code
+    const char* msg                    ///< Error message
+);
+
 /* @} */// End of SysUtils Functions
 
