Index: /trunk/psLib/src/image/psImageStats.c
===================================================================
--- /trunk/psLib/src/image/psImageStats.c	(revision 1447)
+++ /trunk/psLib/src/image/psImageStats.c	(revision 1448)
@@ -10,6 +10,6 @@
 *  @author George Gusciora, MHPCC
 *
-*  @version $Revision: 1.32 $ $Name: not supported by cvs2svn $
-*  @date $Date: 2004-08-10 01:05:53 $
+*  @version $Revision: 1.33 $ $Name: not supported by cvs2svn $
+*  @date $Date: 2004-08-10 01:55:34 $
 *
 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -327,5 +327,5 @@
  
  *****************************************************************************/
-int psImageEvalPolynomial(const psImage* input, const psPolynomial2D* coeffs)
+psImage* psImageEvalPolynomial(psImage* input, const psPolynomial2D* coeffs)
 {
     int x = 0;
Index: /trunk/psLib/src/image/psImageStats.h
===================================================================
--- /trunk/psLib/src/image/psImageStats.h	(revision 1447)
+++ /trunk/psLib/src/image/psImageStats.h	(revision 1448)
@@ -9,6 +9,6 @@
 *  @author George Gusciora, MHPCC
 *
-*  @version $Revision: 1.15 $ $Name: not supported by cvs2svn $
-*  @date $Date: 2004-08-10 01:05:53 $
+*  @version $Revision: 1.16 $ $Name: not supported by cvs2svn $
+*  @date $Date: 2004-08-10 01:55:34 $
 *
 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -80,6 +80,6 @@
  *  @return psImage*    the resulting image
  */
-int psImageEvalPolynomial(
-    const psImage* input,              ///< input image
+psImage* psImageEvalPolynomial(
+    psImage* input,                    ///< input image
     const psPolynomial2D* coeffs       ///< coefficient structure carries in desired terms
 );
Index: /trunk/psLib/src/imageops/psImageStats.c
===================================================================
--- /trunk/psLib/src/imageops/psImageStats.c	(revision 1447)
+++ /trunk/psLib/src/imageops/psImageStats.c	(revision 1448)
@@ -10,6 +10,6 @@
 *  @author George Gusciora, MHPCC
 *
-*  @version $Revision: 1.32 $ $Name: not supported by cvs2svn $
-*  @date $Date: 2004-08-10 01:05:53 $
+*  @version $Revision: 1.33 $ $Name: not supported by cvs2svn $
+*  @date $Date: 2004-08-10 01:55:34 $
 *
 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -327,5 +327,5 @@
  
  *****************************************************************************/
-int psImageEvalPolynomial(const psImage* input, const psPolynomial2D* coeffs)
+psImage* psImageEvalPolynomial(psImage* input, const psPolynomial2D* coeffs)
 {
     int x = 0;
Index: /trunk/psLib/src/imageops/psImageStats.h
===================================================================
--- /trunk/psLib/src/imageops/psImageStats.h	(revision 1447)
+++ /trunk/psLib/src/imageops/psImageStats.h	(revision 1448)
@@ -9,6 +9,6 @@
 *  @author George Gusciora, MHPCC
 *
-*  @version $Revision: 1.15 $ $Name: not supported by cvs2svn $
-*  @date $Date: 2004-08-10 01:05:53 $
+*  @version $Revision: 1.16 $ $Name: not supported by cvs2svn $
+*  @date $Date: 2004-08-10 01:55:34 $
 *
 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -80,6 +80,6 @@
  *  @return psImage*    the resulting image
  */
-int psImageEvalPolynomial(
-    const psImage* input,              ///< input image
+psImage* psImageEvalPolynomial(
+    psImage* input,                    ///< input image
     const psPolynomial2D* coeffs       ///< coefficient structure carries in desired terms
 );
Index: /trunk/psLib/src/sys/psAbort.h
===================================================================
--- /trunk/psLib/src/sys/psAbort.h	(revision 1447)
+++ /trunk/psLib/src/sys/psAbort.h	(revision 1448)
@@ -12,6 +12,6 @@
  *  @author Eric Van Alst, MHPCC
  *
- *  @version $Revision: 1.7 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2004-08-09 23:40:55 $
+ *  @version $Revision: 1.8 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2004-08-10 01:55:34 $
  *
  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -37,8 +37,9 @@
  *
  */
-void psAbort(const char *name,  ///< Source of abort such as file or function detected
-             const char *fmt,   ///< A printf style formatting statement defining msg
-             ...
-            );
+void psAbort(
+    const char *name,                  ///< Source of abort such as file or function detected
+    const char *fmt,                   ///< A printf style formatting statement defining msg
+    ...
+);
 
 /* @} */// Doxygen - End of SystemGroup Functions
Index: /trunk/psLib/src/sys/psError.h
===================================================================
--- /trunk/psLib/src/sys/psError.h	(revision 1447)
+++ /trunk/psLib/src/sys/psError.h	(revision 1448)
@@ -13,6 +13,6 @@
  *  @author Eric Van Alst, MHPCC
  *
- *  @version $Revision: 1.7 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2004-08-09 23:40:55 $
+ *  @version $Revision: 1.8 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2004-08-10 01:55:34 $
  *
  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -32,11 +32,10 @@
  *  log message.
  *
- *  @return  void No return value
- *
  */
-void psError(const char *name,  ///< Source of error such as file or function detected
-             const char *fmt,   ///< A printf style formatting statement defining msg
-             ...
-            );
+void psError(
+    const char *name,                  ///< Source of error such as file or function detected
+    const char *fmt,                   ///< A printf style formatting statement defining msg
+    ...
+);
 
 /* @} */// End of SysUtils Functions
Index: /trunk/psLib/src/sys/psLogMsg.c
===================================================================
--- /trunk/psLib/src/sys/psLogMsg.c	(revision 1447)
+++ /trunk/psLib/src/sys/psLogMsg.c	(revision 1448)
@@ -12,6 +12,6 @@
  *  @author George Gusciora, MHPCC
  *
- *  @version $Revision: 1.25 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2004-08-09 23:40:55 $
+ *  @version $Revision: 1.26 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2004-08-10 01:55:34 $
  *
  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -89,5 +89,5 @@
  An integer specifying the old log destination.
  *****************************************************************************/
-int psLogSetDestination(const char *dest)
+bool psLogSetDestination(const char *dest)
 {
     char protocol[5];
@@ -104,10 +104,10 @@
         }
         logDest = NULL;
-        return 0;
+        return true;
     }
 
     if (sscanf(dest, "%4s:%256s", protocol, location) < 2) {
         psError(__func__, "The specified destination, %s, is malformed.", dest);
-        return 1;
+        return false;
     }
 
@@ -118,5 +118,5 @@
             }
             logDest = stderr;
-            return 0;
+            return true;
         }
         if (strcmp(location, "stdout") == 0) {
@@ -125,5 +125,5 @@
             }
             logDest = stdout;
-            return 0;
+            return true;
         }
         psError(__func__, "The location, %s, for protocol 'dest' is invalid.", location);
@@ -134,5 +134,5 @@
         if (file == NULL) {
             psError(__func__, "Could not open file '%s' for output.", location);
-            return 1;
+            return false;
         }
         if (logDest != NULL && logDest != stderr && logDest != stdout) {
@@ -140,9 +140,9 @@
         }
         logDest = file;
-        return 0;
+        return true;
     }
 
     psError(__func__, "Do not know how to handle the protocol '%s'.", protocol);
-    return 1;
+    return false;
 }
 
Index: /trunk/psLib/src/sys/psLogMsg.h
===================================================================
--- /trunk/psLib/src/sys/psLogMsg.h	(revision 1447)
+++ /trunk/psLib/src/sys/psLogMsg.h	(revision 1448)
@@ -12,6 +12,6 @@
  *  @author George Gusciora, MHPCC
  *
- *  @version $Revision: 1.15 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2004-08-09 23:40:55 $
+ *  @version $Revision: 1.16 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2004-08-10 01:55:34 $
  *
  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -20,4 +20,5 @@
 #define PS_LOG_MSG_H
 #include <stdarg.h>
+#include <stdbool.h>
 
 /** @addtogroup LogTrace
@@ -25,58 +26,76 @@
  */
 
-/// This procedure sets the destination for future log messages.  Currently
-/// the destination is specified by an integer which can have the following
-/// pre-defined values: PS_LOG_NONE, PS_LOG_TO_STDOUT, and PS_LOG_TO_STDERR.
-/// In future versions, this procedure will take a character string as an
-/// argument which can specify more general log destinations.
-int psLogSetDestination(const char *dest        ///< Specifies where to send messages.
-                       );
+/** This procedure sets the destination for future log messages.  Currently
+ *  the destination is specified by an integer which can have the following
+ *  pre-defined values: PS_LOG_NONE, PS_LOG_TO_STDOUT, and PS_LOG_TO_STDERR.
+ *  In future versions, this procedure will take a character string as an
+ *  argument which can specify more general log destinations.
+ *
+ *  @return int     true if set successfully, otherwise false.
+ */
+bool psLogSetDestination(
+    const char *dest                   ///< Specifies where to send messages.
+);
 
-/// This procedure sets the message level for future log messages.  Subsequent
-/// log messages, with a log level of "mylevel", will only be logged if
-/// "mylevel" is less than the current log level set by this procedure.
-/// Ie. higher values set by this procedure will cause more log messages to
-/// be displayed.
-int psLogSetLevel(int level     ///< Specifies the system log level
-                 );
+/** This procedure sets the message level for future log messages.  Subsequent
+ *  log messages, with a log level of "mylevel", will only be logged if
+ *  "mylevel" is less than the current log level set by this procedure.
+ *  Ie. higher values set by this procedure will cause more log messages to
+ *  be displayed.
+ *
+ *  @return int    old logging level
+ */
+int psLogSetLevel(
+    int level                          ///< Specifies the system log level
+);
 
-/// This procedure sets the log format for future log messages.  The argument
-/// must be a character string consistsing of the letters H (host), L
-/// (level), M (message), N (name), and T (time).  The default is "THLNM".
-/// Deleting a letter from the string will cause the associated information
-/// to not be logged.
-void psLogSetFormat(const char *fmt     ///< Specifies the system log format
-                   );
+/** This procedure sets the log format for future log messages.  The argument
+ *  must be a character string consistsing of the letters H (host), L
+ *  (level), M (message), N (name), and T (time).  The default is "THLNM".
+ *  Deleting a letter from the string will cause the associated information
+ *  to not be logged.
+ *
+ */
+void psLogSetFormat(
+    const char *fmt                    ///< Specifies the system log format
+);
 
-/// This procedure logs a message to the destination set by a prior
-/// call to psLogSetDestination(), if myLevel is less than the level
-/// specified by a prior call to psLogSetLevel().  The message is specified
-/// with a printf-stype string an arguments.
-void psLogMsg(const char *name, ///< name of the log source
-              int myLevel,      ///< severity level of this log message
-              const char *fmt, ...      ///< printf-style format command
-             );
+/** This procedure logs a message to the destination set by a prior
+ *  call to psLogSetDestination(), if myLevel is less than the level
+ *  specified by a prior call to psLogSetLevel().  The message is specified
+ *  with a printf-stype string an arguments.
+ *
+ */
+void psLogMsg(
+    const char *name,                  ///< name of the log source
+    int myLevel,                       ///< severity level of this log message
+    const char *fmt,                   ///< printf-style format command
+    ...
+);
 
-/// This procedure is functionally equivalent to psLogMsg(), except that
-/// it takes a va_list as the message parameter, not a printf-style string.
-void psLogMsgV(const char *name,        ///< name of the log source
-               int myLevel,     ///< severity level of this log message
-               const char *fmt, ///< printf-style format command
-               va_list ap       ///< varargs argument list
-              );
+/** This procedure is functionally equivalent to psLogMsg(), except that
+ *  it takes a va_list as the message parameter, not a printf-style string.
+ *
+ */
+void psLogMsgV(
+    const char *name,                  ///< name of the log source
+    int myLevel,                       ///< severity level of this log message
+    const char *fmt,                   ///< printf-style format command
+    va_list ap                         ///< varargs argument list
+);
 
 ///< Status codes for log messages
 enum {
-    PS_LOG_ABORT = 0,
-    PS_LOG_ERROR,
-    PS_LOG_WARN,
-    PS_LOG_INFO
+    PS_LOG_ABORT = 0,                  ///< log message is a critical error, perform an abort after printing
+    PS_LOG_ERROR,                      ///< log message is an error, but don't abort
+    PS_LOG_WARN,                       ///< log message is a warning
+    PS_LOG_INFO                        ///< log message is informational only
 };
 
 ///< Destinations for log messages
 enum {
-    PS_LOG_NONE,
-    PS_LOG_TO_STDERR,
-    PS_LOG_TO_STDOUT
+    PS_LOG_NONE,                       ///< turn off logging
+    PS_LOG_TO_STDERR,                  ///< log to system's stderr
+    PS_LOG_TO_STDOUT                   ///< log to system's stdout
 };
 
Index: /trunk/psLib/src/sys/psMemory.h
===================================================================
--- /trunk/psLib/src/sys/psMemory.h	(revision 1447)
+++ /trunk/psLib/src/sys/psMemory.h	(revision 1448)
@@ -1,5 +1,2 @@
-#if !defined(PS_MEMORY_H)
-#define PS_MEMORY_H
-
 /** @file  psMemory.h
  *
@@ -15,9 +12,12 @@
  *  @ingroup MemoryManagement
  *
- *  @version $Revision: 1.27 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2004-08-09 23:40:55 $
+ *  @version $Revision: 1.28 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2004-08-10 01:55:34 $
  *
  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
  */
+
+#if !defined(PS_MEMORY_H)
+#define PS_MEMORY_H
 
 #include <stdio.h>                     // needed for FILE
@@ -63,15 +63,15 @@
 typedef struct psMemBlock
 {
-    const void *startblock;     ///< initialised to p_psMEMMAGIC
-    struct psMemBlock* previousBlock;   ///< previous block in allocation list
-    struct psMemBlock* nextBlock;       ///< next block allocation list
-    psFreeFcn freeFcn;          ///< deallocator.  If NULL, use generic deallocation.
-    size_t userMemorySize;      ///< the size of the user-portion of the memory block
-    const psMemoryId id;        ///< a unique ID for this allocation
-    const char *file;           ///< set from __FILE__ in e.g. p_psAlloc
-    const int lineno;           ///< set from __LINE__ in e.g. p_psAlloc
-    pthread_mutex_t refCounterMutex;    ///< mutex to ensure exclusive access to reference counter
-    psReferenceCount refCounter;        ///< how many times pointer is referenced
-    const void *endblock;       ///< initialised to p_psMEMMAGIC
+    const void *startblock;            ///< initialised to p_psMEMMAGIC
+    struct psMemBlock* previousBlock;  ///< previous block in allocation list
+    struct psMemBlock* nextBlock;      ///< next block allocation list
+    psFreeFcn freeFcn;                 ///< deallocator.  If NULL, use generic deallocation.
+    size_t userMemorySize;             ///< the size of the user-portion of the memory block
+    const psMemoryId id;               ///< a unique ID for this allocation
+    const char *file;                  ///< set from __FILE__ in e.g. p_psAlloc
+    const int lineno;                  ///< set from __LINE__ in e.g. p_psAlloc
+    pthread_mutex_t refCounterMutex;   ///< mutex to ensure exclusive access to reference counter
+    psReferenceCount refCounter;       ///< how many times pointer is referenced
+    const void *endblock;              ///< initialised to p_psMEMMAGIC
 }
 psMemBlock;
@@ -82,6 +82,7 @@
  *  @ingroup memCallback
  */
-typedef psMemoryId(*psMemAllocateCallback) (const psMemBlock* ptr      ///< the psMemBlock just allocated
-                                           );
+typedef psMemoryId(*psMemAllocateCallback) (
+    const psMemBlock* ptr              ///< the psMemBlock just allocated
+);
 
 /** prototype of memory free callback used by memory functions
@@ -90,6 +91,7 @@
  *  @ingroup memCallback
  */
-typedef psMemoryId(*psMemFreeCallback) (const psMemBlock* ptr  ///< the psMemBlock being freed
-                                       );
+typedef psMemoryId(*psMemFreeCallback) (
+    const psMemBlock* ptr              ///< the psMemBlock being freed
+);
 
 /** prototype of a callback used in error conditions
@@ -100,9 +102,9 @@
  *  @ingroup memCallback
  */
-typedef void (*psMemProblemCallback) (const psMemBlock* ptr,   ///< the pointer to the problematic memory
-                                      // block.
-                                      const char *file, ///< the file in which the problem originated
-                                      int lineno        ///< the line number in which the problem originated
-                                     );
+typedef void (*psMemProblemCallback) (
+    const psMemBlock* ptr,             ///< the pointer to the problematic memory block.
+    const char *file,                  ///< the file in which the problem originated
+    int lineno                         ///< the line number in which the problem originated
+);
 
 /** prototype of a callback function used when memory runs out
@@ -114,6 +116,7 @@
  *  @ingroup memCallback
  */
-typedef void *(*psMemExhaustedCallback) (size_t size    // < the size of buffer required
-                                        );
+typedef void *(*psMemExhaustedCallback) (
+    size_t size                        ///< the size of buffer required
+);
 
 /** Memory allocation.  This operates much like malloc(), but is guaranteed to return a non-NULL value.
@@ -145,14 +148,16 @@
  */
 #ifdef DOXYGEN
-void *psRealloc(void *ptr       ///< Pointer to re-allocate
-                size_t size,    ///< Size required
-               );
-#else
-
-void *p_psRealloc(void *ptr,    ///< Pointer to re-allocate
-                  size_t size,  ///< Size required
-                  const char *file,     ///< File of call
-                  int lineno    ///< Line number of call
-                 );
+void *psRealloc(
+    void *ptr                          ///< Pointer to re-allocate
+    size_t size,                       ///< Size required
+);
+#else
+
+void *p_psRealloc(
+    void *ptr,                         ///< Pointer to re-allocate
+    size_t size,                       ///< Size required
+    const char *file,                  ///< File of call
+    int lineno                         ///< Line number of call
+);
 
 /// Memory re-allocation.  psRealloc sends file and line number to p_psRealloc.
@@ -166,12 +171,14 @@
  */
 #ifdef DOXYGEN
-void psFree(void *ptr,          ///< Pointer to free, if NULL, function returns immediately.
-           );
-#else
-
-void p_psFree(void *ptr,        ///< Pointer to free
-              const char *file, ///< File of call
-              int lineno        ///< Line number of call
-             );
+void psFree(
+    void *ptr,                         ///< Pointer to free, if NULL, function returns immediately.
+);
+#else
+
+void p_psFree(
+    void *ptr,                        ///< Pointer to free
+    const char *file,                 ///< File of call
+    int lineno                        ///< Line number of call
+);
 
 /// Free memory.  psFree sends file and line number to p_psFree.
@@ -194,8 +201,9 @@
  *  @ingroup memTracing
  */
-int psMemCheckLeaks(psMemoryId id0,     ///< don't list blocks with id < id0
-                    psMemBlock* ** arr, ///< pointer to array of pointers to leaked blocks, or NULL
-                    FILE * fd   ///< print list of leaks to fd (or NULL)
-                   );
+int psMemCheckLeaks(
+    psMemoryId id0,                    ///< don't list blocks with id < id0
+    psMemBlock* ** arr,                ///< pointer to array of pointers to leaked blocks, or NULL
+    FILE * fd                          ///< print list of leaks to fd (or NULL)
+);
 
 /** Check for memory corruption.  Scans all currently allocated memory buffers and checks for corruptions,
@@ -204,6 +212,7 @@
  *  @ingroup memTracing
  */
-int psMemCheckCorruption(bool abort_on_error    ///< Abort on detecting corruption?
-                        );
+int psMemCheckCorruption(
+    bool abort_on_error                ///< Abort on detecting corruption?
+);
 
 /** Return reference counter
@@ -211,6 +220,7 @@
  *  @ingroup memRefCount
  */
-psReferenceCount psMemGetRefCounter(void *vptr  ///< Pointer to get refCounter for
-                                   );
+psReferenceCount psMemGetRefCounter(
+    void *vptr                         ///< Pointer to get refCounter for
+);
 
 /** Increment reference counter and return the pointer
@@ -219,12 +229,14 @@
  */
 #ifdef DOXYGEN
-void *psMemIncrRefCounter(void *vptr    ///< Pointer to increment refCounter, and return
-                         );
-#else
-
-void *p_psMemIncrRefCounter(void *vptr, ///< Pointer to increment refCounter, and return
-                            const char *file,   ///< File of call
-                            int lineno  ///< Line number of call
-                           );
+void *psMemIncrRefCounter(
+    void *vptr                         ///< Pointer to increment refCounter, and return
+);
+#else
+
+void *p_psMemIncrRefCounter(
+    void *vptr,                        ///< Pointer to increment refCounter, and return
+    const char *file,                  ///< File of call
+    int lineno                         ///< Line number of call
+);
 
 #define psMemIncrRefCounter(vptr) p_psMemIncrRefCounter(vptr, __FILE__, __LINE__)
@@ -234,64 +246,127 @@
  *
  *  @ingroup memRefCount
- */
-#ifdef DOXYGEN
-void *psMemDecrRefCounter(void *vptr    ///< Pointer to decrement refCounter, and return
-                         );
-#else
-
-void *p_psMemDecrRefCounter(void *vptr, ///< Pointer to decrement refCounter, and return
-                            const char *file,   ///< File of call
-                            int lineno  ///< Line number of call
-                           );
+ *
+ *  @return void*    the pointer deremented in refCount, or NULL if pointer is 
+ *                   fully dereferenced.
+ */
+#ifdef DOXYGEN
+void* psMemDecrRefCounter(
+    void* vptr                         ///< Pointer to decrement refCounter, and return
+);
+#else
+
+void *p_psMemDecrRefCounter(
+    void *vptr,                        ///< Pointer to decrement refCounter, and return
+    const char *file,                  ///< File of call
+    int lineno                         ///< Line number of call
+);
 
 #define psMemDecrRefCounter(vptr) p_psMemDecrRefCounter(vptr, __FILE__, __LINE__)
 #endif
 
-/** Set callback for problems
- *  @ingroup memCallback
- */
-psMemProblemCallback psMemProblemCallbackSet(psMemProblemCallback func  ///< Function to run
-                                            );
-
-/** Set callback for out-of-memory
- *
- *  @ingroup memCallback
- */
-psMemExhaustedCallback psMemExhaustedCallbackSet(psMemExhaustedCallback func    ///< Function to run
-                                                );
+/** Set callback for problems.
+ *
+ *  At various occasions, the memory manager can check the state of the memory 
+ *  stack. If any of these checks discover that the memory stack is corrupted,
+ *  the psMemProblemCallback is called.
+ 
+ *  @ingroup memCallback
+ *
+ *  @return psMemProblemCallback       old psMemProblemCallback function
+ */
+psMemProblemCallback psMemProblemCallbackSet(
+    psMemProblemCallback func          ///< Function to run at memory problem detection
+);
+
+/** Set callback for out-of-memory.
+ *
+ *  If not enough memory is available to satisfy a request by psAlloc or 
+ *  psRealloc, these functions attempt to find an alternative solution by 
+ *  calling the psMemExhaustedCallback, a function which may be set by the 
+ *  programmer in appropriate circumstances, rather than immediately fail. 
+ *  The typical use of such a feature may be when a program needs a large 
+ *  chunk of memory to do an operation, but the exact size is not critical. 
+ *  This feature gives the programmer the opportunity to make a smaller 
+ *  request and try again, limiting the size of the operating buffer.
+ *
+ *  @ingroup memCallback
+ *
+ *  @return psMemExhaustedCallback     old psMemExhaustedCallback function
+ */
+psMemExhaustedCallback psMemExhaustedCallbackSet(
+    psMemExhaustedCallback func        ///< Function to run at memory exhaustion
+);
 
 /** Set call back for when a particular memory block is allocated
  *
- *  @ingroup memCallback
- */
-psMemAllocateCallback psMemAllocateCallbackSet(psMemAllocateCallback func       ///< Function to run
-                                              );
+ *  A private variable, p_psMemAllocateID, can be used to trace the allocation 
+ *  and freeing of specific memory blocks. If p_psMemAllocateID is set and a 
+ *  memory block with that ID is allocated, psMemAllocateCallback is called 
+ *  just before memory is returned to the calling function.
+ *
+ *  @ingroup memCallback
+ *
+ *  @return psMemAllocateCallback      old psMemAllocateCallback function
+ */
+psMemAllocateCallback psMemAllocateCallbackSet(
+    psMemAllocateCallback func       ///< Function to run at memory allocation of specific mem block
+);
 
 /** Set call back for when a particular memory block is freed
  *
- *  @ingroup memCallback
- */
-psMemFreeCallback psMemFreeCallbackSet(psMemFreeCallback func   ///< Function to run
-                                      );
+ *  A private variable, p_psMemFreeID, can be used to trace the freeing of 
+ *  specific memory blocks. If p_psMemFreeID is set and the memory block with 
+ *  the ID is about to be freed, the psMemFreeCallback callback is called just
+ *  before the memory block is freed.
+ *
+ *  @ingroup memCallback
+ *
+ *  @return psMemFreeCallback          old psMemFreeCallback function
+ */
+psMemFreeCallback psMemFreeCallbackSet(
+    psMemFreeCallback func             ///< Function to run at memory free of specific mem block
+);
 
 /** get next memory ID
  *
  *  @ingroup memCallback
+ *
+ *  @return psMemoryId                 the next memory ID to be used
  */
 psMemoryId psMemGetId(void);
 
-/** set p_psMemAllocateID to id
- *
- *  @ingroup memCallback
- */
-psMemoryId psMemAllocateCallbackSetID(psMemoryId id     ///< ID to set
-                                     );
+/** set p_psMemAllocateID to specific id
+ *
+ *  A private variable, p_psMemAllocateID, can be used to trace the allocation 
+ *  and freeing of specific memory blocks. If p_psMemAllocateID is set and a 
+ *  memory block with that ID is allocated, psMemAllocateCallback is called 
+ *  just before memory is returned to the calling function.
+ *
+ *  @ingroup memCallback
+ *
+ *  @return psMemoryId       
+ *
+ *  @see psMemAllocateCallbackSet    
+ */
+psMemoryId psMemAllocateCallbackSetID(
+    psMemoryId id                      ///< ID to set
+);
 
 /** set p_psMemFreeID to id
  *
- *  @ingroup memCallback
- */
-psMemoryId psMemFreeCallbackSetID(psMemoryId id ///< ID to set
-                                 );
+ *  A private variable, p_psMemFreeID, can be used to trace the freeing of 
+ *  specific memory blocks. If p_psMemFreeID is set and the memory block with 
+ *  the ID is about to be freed, the psMemFreeCallback callback is called just
+ *  before the memory block is freed.
+ *
+ *  @ingroup memCallback
+ *
+ *  @return psMemoryId                 the old p_psMemFreeID
+ *
+ *  @see psMemFreeCallbackSet
+ */
+psMemoryId psMemFreeCallbackSetID(
+    psMemoryId id                      ///< ID to set
+);
 
 //@} End of Memory Management Functions
@@ -306,12 +381,12 @@
 #pragma GCC poison malloc realloc calloc free
 #else
-#                define malloc(S)       _Pragma("error Use of malloc is not allowed.  Use psAlloc instead.")
-#                define realloc(P,S)    _Pragma("error Use of realloc is not allowed.  Use psRealloc instead.")
-#                define calloc(S)       _Pragma("error Use of calloc is not allowed.  Use psAlloc instead.")
-#                define free(P)         _Pragma("error Use of free is not allowed.  Use psFree instead.")
-#            endif
-#        endif
-
-#    endif
+#define malloc(S)       _Pragma("error Use of malloc is not allowed.  Use psAlloc instead.")
+#define realloc(P,S)    _Pragma("error Use of realloc is not allowed.  Use psRealloc instead.")
+#define calloc(S)       _Pragma("error Use of calloc is not allowed.  Use psAlloc instead.")
+#define free(P)         _Pragma("error Use of free is not allowed.  Use psFree instead.")
+#endif
+#endif
+
+#endif
 // doxygen skip
 
Index: /trunk/psLib/src/sys/psString.h
===================================================================
--- /trunk/psLib/src/sys/psString.h	(revision 1447)
+++ /trunk/psLib/src/sys/psString.h	(revision 1448)
@@ -1,3 +1,2 @@
-
 /** @file  psString.h
  *
@@ -11,6 +10,6 @@
  *  @author Eric Van Alst, MHPCC
  *
- *  @version $Revision: 1.7 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2004-08-09 23:40:55 $
+ *  @version $Revision: 1.8 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2004-08-10 01:55:34 $
  *
  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -20,26 +19,7 @@
 #define PS_STRING_H
 
-/******************************************************************************/
 
-/*  DEFINE STATEMENTS                                                         */
-
-/******************************************************************************/
-
-/** This macro will convert the arguement to a quoted string */
+/** This macro will convert the argument to a quoted string */
 #define PS_STRING(S)  #S
-
-/******************************************************************************/
-
-/*  TYPE DEFINITIONS                                                          */
-
-/******************************************************************************/
-
-// None
-
-/*****************************************************************************/
-
-/* FUNCTION PROTOTYPES                                                       */
-
-/*****************************************************************************/
 
 // Doxygen group tags
@@ -54,11 +34,11 @@
  *  plus one and copy the input string to the newly allocated memory.
  *
- *  @return  char* Copy of input string
+ *  @return char*      Copy of input string
  *
  */
-
-char *psStringCopy(const char *str
-                   /**< Input string of characters to copy */
-                  );
+char *psStringCopy(
+    const char *str
+    /**< Input string of characters to copy */
+);
 
 /** Copies the input string up to the specified number of characters
@@ -78,10 +58,11 @@
 /*@null@*/
 
-char *psStringNCopy(const char *str,
-                    /**< Input string of characters to copy */
+char *psStringNCopy(
+    const char *str,
+    /**< Input string of characters to copy */
 
-                    int nChar
-                    /**< Number of bytes to allocate for string copy */
-                   );
+    int nChar
+    /**< Number of bytes to allocate for string copy */
+);
 
 /* @} */// Doxygen - End of SystemGroup Functions
Index: /trunk/psLib/src/sys/psType.h
===================================================================
--- /trunk/psLib/src/sys/psType.h	(revision 1447)
+++ /trunk/psLib/src/sys/psType.h	(revision 1448)
@@ -11,6 +11,6 @@
 *  @author Ross Harman, MHPCC
 *
-*  @version $Revision: 1.19 $ $Name: not supported by cvs2svn $
-*  @date $Date: 2004-08-09 23:40:55 $
+*  @version $Revision: 1.20 $ $Name: not supported by cvs2svn $
+*  @date $Date: 2004-08-10 01:55:34 $
 *
 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -40,66 +40,66 @@
  */
 
-typedef uint8_t psU8;           ///< 8-bit unsigned int
-typedef uint16_t psU16;         ///< 16-bit unsigned int
-typedef uint32_t psU32;         ///< 32-bit unsigned int
-typedef uint64_t psU64;         ///< 64-bit unsigned int
-typedef int8_t psS8;            ///< 8-bit signed int
-typedef int16_t psS16;          ///< 16-bit signed int
-typedef int32_t psS32;          ///< 32-bit signed int
-typedef int64_t psS64;          ///< 64-bit signed int
-typedef float psF32;            ///< 32-bit floating point
-typedef double psF64;           ///< 64-bit floating point
-typedef complex float psC32;    ///< complex with 32-bit floating point Real and Imagary numbers
-typedef complex double psC64;   ///< complex with 64-bit floating point Real and Imagary numbers
-typedef void *psPTR;            ///< void pointer
+typedef uint8_t psU8;                  ///< 8-bit unsigned int
+typedef uint16_t psU16;                ///< 16-bit unsigned int
+typedef uint32_t psU32;                ///< 32-bit unsigned int
+typedef uint64_t psU64;                ///< 64-bit unsigned int
+typedef int8_t psS8;                   ///< 8-bit signed int
+typedef int16_t psS16;                 ///< 16-bit signed int
+typedef int32_t psS32;                 ///< 32-bit signed int
+typedef int64_t psS64;                 ///< 64-bit signed int
+typedef float psF32;                   ///< 32-bit floating point
+typedef double psF64;                  ///< 64-bit floating point
+typedef complex float psC32;           ///< complex with 32-bit floating point Real and Imagary numbers
+typedef complex double psC64;          ///< complex with 64-bit floating point Real and Imagary numbers
+typedef void *psPTR;                   ///< void pointer
 
 typedef enum {
-    PS_TYPE_S8 = 0x0101,        ///< Character.
-    PS_TYPE_S16 = 0x0102,                  ///< Short integer.
-    PS_TYPE_S32 = 0x0104,                  ///< Integer.
-    PS_TYPE_S64 = 0x0108,                  ///< Long integer.
-    PS_TYPE_U8 = 0x0301,                   ///< Unsigned character.
-    PS_TYPE_U16 = 0x0302,                  ///< Unsigned short integer.
-    PS_TYPE_U32 = 0x0304,                  ///< Unsigned integer.
-    PS_TYPE_U64 = 0x0308,                  ///< Unsigned long integer.
-    PS_TYPE_F32 = 0x0404,                  ///< Single-precision Floating point.
-    PS_TYPE_F64 = 0x0408,                  ///< Double-precision floating point.
-    PS_TYPE_C32 = 0x0808,                  ///< Complex numbers consisting of single-precision floating
-    // point.
-    PS_TYPE_C64 = 0x0810,                  ///< Complex numbers consisting of double-precision floating
-    // point.
-    PS_TYPE_PTR = 0x0000                   ///< Something else that's not supported for arithmetic.
+    PS_TYPE_S8 = 0x0101,               ///< Character.
+    PS_TYPE_S16 = 0x0102,              ///< Short integer.
+    PS_TYPE_S32 = 0x0104,              ///< Integer.
+    PS_TYPE_S64 = 0x0108,              ///< Long integer.
+    PS_TYPE_U8 = 0x0301,               ///< Unsigned character.
+    PS_TYPE_U16 = 0x0302,              ///< Unsigned short integer.
+    PS_TYPE_U32 = 0x0304,              ///< Unsigned integer.
+    PS_TYPE_U64 = 0x0308,              ///< Unsigned long integer.
+    PS_TYPE_F32 = 0x0404,              ///< Single-precision Floating point.
+    PS_TYPE_F64 = 0x0408,              ///< Double-precision floating point.
+    PS_TYPE_C32 = 0x0808,              ///< Complex numbers consisting of single-precision floating point.
+    PS_TYPE_C64 = 0x0810,              ///< Complex numbers consisting of double-precision floating point.
+    PS_TYPE_PTR = 0x0000               ///< Something else that's not supported for arithmetic.
 } psElemType;
 
-#define PS_TYPE_MASK PS_TYPE_U8        ///< the psElemType to use for mask image
-#define PS_TYPE_MASK_DATA U8           ///< the data member to use for mask image
-#define PS_TYPE_MASK_NAME "psU8"
-typedef psU8 psMaskType;        ///< the C datatype for a mask image
+#define PS_TYPE_MASK PS_TYPE_U8        /**< the psElemType to use for mask image */
+#define PS_TYPE_MASK_DATA U8           /**< the data member to use for mask image */
+#define PS_TYPE_MASK_NAME "psU8"       /**< the data type for mask as a string */
 
-#define PS_MIN_S8        INT8_MIN
-#define PS_MIN_S16       INT16_MIN
-#define PS_MIN_S32       INT32_MIN
-#define PS_MIN_S64       INT64_MIN
-#define PS_MIN_U8        0
-#define PS_MIN_U16       0
-#define PS_MIN_U32       0
-#define PS_MIN_U64       0
-#define PS_MIN_F32       -FLT_MAX
-#define PS_MIN_F64       -DBL_MAX
-#define PS_MIN_C32       -FLT_MAX
-#define PS_MIN_C64       -DBL_MAX
+typedef psU8 psMaskType;               ///< the C datatype for a mask image
 
-#define PS_MAX_S8        INT8_MAX
-#define PS_MAX_S16       INT16_MAX
-#define PS_MAX_S32       INT32_MAX
-#define PS_MAX_S64       INT64_MAX
-#define PS_MAX_U8        UINT8_MAX
-#define PS_MAX_U16       UINT16_MAX
-#define PS_MAX_U32       UINT32_MAX
-#define PS_MAX_U64       UINT64_MAX
-#define PS_MAX_F32       FLT_MAX
-#define PS_MAX_F64       DBL_MAX
-#define PS_MAX_C32       FLT_MAX
-#define PS_MAX_C64       DBL_MAX
+
+#define PS_MIN_S8        INT8_MIN      /**< minimum valid psS8 value */
+#define PS_MIN_S16       INT16_MIN     /**< minimum valid psS16 value */
+#define PS_MIN_S32       INT32_MIN     /**< minimum valid psS32 value */
+#define PS_MIN_S64       INT64_MIN     /**< minimum valid psS64 value */
+#define PS_MIN_U8        0             /**< minimum valid psU8 value */
+#define PS_MIN_U16       0             /**< minimum valid psU16 value */
+#define PS_MIN_U32       0             /**< minimum valid psU32 value */
+#define PS_MIN_U64       0             /**< minimum valid psU64 value */
+#define PS_MIN_F32       -FLT_MAX      /**< minimum valid psF32 value */
+#define PS_MIN_F64       -DBL_MAX      /**< minimum valid psF64 value */
+#define PS_MIN_C32       -FLT_MAX      /**< minimum valid real or imaginary psC32 value */
+#define PS_MIN_C64       -DBL_MAX      /**< minimum valid real or imaginary psC32 value */
+
+#define PS_MAX_S8        INT8_MAX      /**< maximum valid psS8 value */
+#define PS_MAX_S16       INT16_MAX     /**< maximum valid psS16 value */
+#define PS_MAX_S32       INT32_MAX     /**< maximum valid psS32 value */
+#define PS_MAX_S64       INT64_MAX     /**< maximum valid psS64 value */
+#define PS_MAX_U8        UINT8_MAX     /**< maximum valid psU8 value */
+#define PS_MAX_U16       UINT16_MAX    /**< maximum valid psU16 value */
+#define PS_MAX_U32       UINT32_MAX    /**< maximum valid psU32 value */
+#define PS_MAX_U64       UINT64_MAX    /**< maximum valid psU64 value */
+#define PS_MAX_F32       FLT_MAX       /**< maximum valid psF32 value */
+#define PS_MAX_F64       DBL_MAX       /**< maximum valid psF64 value */
+#define PS_MAX_C32       FLT_MAX       /**< maximum valid real or imaginary psC32 value */
+#define PS_MAX_C64       DBL_MAX       /**< maximum valid real or imaginary psC32 value */
 
 /// Macro to get the bad pixel reason code (stored as part of mask value)
Index: /trunk/psLib/src/sysUtils/psAbort.h
===================================================================
--- /trunk/psLib/src/sysUtils/psAbort.h	(revision 1447)
+++ /trunk/psLib/src/sysUtils/psAbort.h	(revision 1448)
@@ -12,6 +12,6 @@
  *  @author Eric Van Alst, MHPCC
  *
- *  @version $Revision: 1.7 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2004-08-09 23:40:55 $
+ *  @version $Revision: 1.8 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2004-08-10 01:55:34 $
  *
  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -37,8 +37,9 @@
  *
  */
-void psAbort(const char *name,  ///< Source of abort such as file or function detected
-             const char *fmt,   ///< A printf style formatting statement defining msg
-             ...
-            );
+void psAbort(
+    const char *name,                  ///< Source of abort such as file or function detected
+    const char *fmt,                   ///< A printf style formatting statement defining msg
+    ...
+);
 
 /* @} */// Doxygen - End of SystemGroup Functions
Index: /trunk/psLib/src/sysUtils/psError.h
===================================================================
--- /trunk/psLib/src/sysUtils/psError.h	(revision 1447)
+++ /trunk/psLib/src/sysUtils/psError.h	(revision 1448)
@@ -13,6 +13,6 @@
  *  @author Eric Van Alst, MHPCC
  *
- *  @version $Revision: 1.7 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2004-08-09 23:40:55 $
+ *  @version $Revision: 1.8 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2004-08-10 01:55:34 $
  *
  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -32,11 +32,10 @@
  *  log message.
  *
- *  @return  void No return value
- *
  */
-void psError(const char *name,  ///< Source of error such as file or function detected
-             const char *fmt,   ///< A printf style formatting statement defining msg
-             ...
-            );
+void psError(
+    const char *name,                  ///< Source of error such as file or function detected
+    const char *fmt,                   ///< A printf style formatting statement defining msg
+    ...
+);
 
 /* @} */// End of SysUtils Functions
Index: /trunk/psLib/src/sysUtils/psLogMsg.c
===================================================================
--- /trunk/psLib/src/sysUtils/psLogMsg.c	(revision 1447)
+++ /trunk/psLib/src/sysUtils/psLogMsg.c	(revision 1448)
@@ -12,6 +12,6 @@
  *  @author George Gusciora, MHPCC
  *
- *  @version $Revision: 1.25 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2004-08-09 23:40:55 $
+ *  @version $Revision: 1.26 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2004-08-10 01:55:34 $
  *
  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -89,5 +89,5 @@
  An integer specifying the old log destination.
  *****************************************************************************/
-int psLogSetDestination(const char *dest)
+bool psLogSetDestination(const char *dest)
 {
     char protocol[5];
@@ -104,10 +104,10 @@
         }
         logDest = NULL;
-        return 0;
+        return true;
     }
 
     if (sscanf(dest, "%4s:%256s", protocol, location) < 2) {
         psError(__func__, "The specified destination, %s, is malformed.", dest);
-        return 1;
+        return false;
     }
 
@@ -118,5 +118,5 @@
             }
             logDest = stderr;
-            return 0;
+            return true;
         }
         if (strcmp(location, "stdout") == 0) {
@@ -125,5 +125,5 @@
             }
             logDest = stdout;
-            return 0;
+            return true;
         }
         psError(__func__, "The location, %s, for protocol 'dest' is invalid.", location);
@@ -134,5 +134,5 @@
         if (file == NULL) {
             psError(__func__, "Could not open file '%s' for output.", location);
-            return 1;
+            return false;
         }
         if (logDest != NULL && logDest != stderr && logDest != stdout) {
@@ -140,9 +140,9 @@
         }
         logDest = file;
-        return 0;
+        return true;
     }
 
     psError(__func__, "Do not know how to handle the protocol '%s'.", protocol);
-    return 1;
+    return false;
 }
 
Index: /trunk/psLib/src/sysUtils/psLogMsg.h
===================================================================
--- /trunk/psLib/src/sysUtils/psLogMsg.h	(revision 1447)
+++ /trunk/psLib/src/sysUtils/psLogMsg.h	(revision 1448)
@@ -12,6 +12,6 @@
  *  @author George Gusciora, MHPCC
  *
- *  @version $Revision: 1.15 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2004-08-09 23:40:55 $
+ *  @version $Revision: 1.16 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2004-08-10 01:55:34 $
  *
  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -20,4 +20,5 @@
 #define PS_LOG_MSG_H
 #include <stdarg.h>
+#include <stdbool.h>
 
 /** @addtogroup LogTrace
@@ -25,58 +26,76 @@
  */
 
-/// This procedure sets the destination for future log messages.  Currently
-/// the destination is specified by an integer which can have the following
-/// pre-defined values: PS_LOG_NONE, PS_LOG_TO_STDOUT, and PS_LOG_TO_STDERR.
-/// In future versions, this procedure will take a character string as an
-/// argument which can specify more general log destinations.
-int psLogSetDestination(const char *dest        ///< Specifies where to send messages.
-                       );
+/** This procedure sets the destination for future log messages.  Currently
+ *  the destination is specified by an integer which can have the following
+ *  pre-defined values: PS_LOG_NONE, PS_LOG_TO_STDOUT, and PS_LOG_TO_STDERR.
+ *  In future versions, this procedure will take a character string as an
+ *  argument which can specify more general log destinations.
+ *
+ *  @return int     true if set successfully, otherwise false.
+ */
+bool psLogSetDestination(
+    const char *dest                   ///< Specifies where to send messages.
+);
 
-/// This procedure sets the message level for future log messages.  Subsequent
-/// log messages, with a log level of "mylevel", will only be logged if
-/// "mylevel" is less than the current log level set by this procedure.
-/// Ie. higher values set by this procedure will cause more log messages to
-/// be displayed.
-int psLogSetLevel(int level     ///< Specifies the system log level
-                 );
+/** This procedure sets the message level for future log messages.  Subsequent
+ *  log messages, with a log level of "mylevel", will only be logged if
+ *  "mylevel" is less than the current log level set by this procedure.
+ *  Ie. higher values set by this procedure will cause more log messages to
+ *  be displayed.
+ *
+ *  @return int    old logging level
+ */
+int psLogSetLevel(
+    int level                          ///< Specifies the system log level
+);
 
-/// This procedure sets the log format for future log messages.  The argument
-/// must be a character string consistsing of the letters H (host), L
-/// (level), M (message), N (name), and T (time).  The default is "THLNM".
-/// Deleting a letter from the string will cause the associated information
-/// to not be logged.
-void psLogSetFormat(const char *fmt     ///< Specifies the system log format
-                   );
+/** This procedure sets the log format for future log messages.  The argument
+ *  must be a character string consistsing of the letters H (host), L
+ *  (level), M (message), N (name), and T (time).  The default is "THLNM".
+ *  Deleting a letter from the string will cause the associated information
+ *  to not be logged.
+ *
+ */
+void psLogSetFormat(
+    const char *fmt                    ///< Specifies the system log format
+);
 
-/// This procedure logs a message to the destination set by a prior
-/// call to psLogSetDestination(), if myLevel is less than the level
-/// specified by a prior call to psLogSetLevel().  The message is specified
-/// with a printf-stype string an arguments.
-void psLogMsg(const char *name, ///< name of the log source
-              int myLevel,      ///< severity level of this log message
-              const char *fmt, ...      ///< printf-style format command
-             );
+/** This procedure logs a message to the destination set by a prior
+ *  call to psLogSetDestination(), if myLevel is less than the level
+ *  specified by a prior call to psLogSetLevel().  The message is specified
+ *  with a printf-stype string an arguments.
+ *
+ */
+void psLogMsg(
+    const char *name,                  ///< name of the log source
+    int myLevel,                       ///< severity level of this log message
+    const char *fmt,                   ///< printf-style format command
+    ...
+);
 
-/// This procedure is functionally equivalent to psLogMsg(), except that
-/// it takes a va_list as the message parameter, not a printf-style string.
-void psLogMsgV(const char *name,        ///< name of the log source
-               int myLevel,     ///< severity level of this log message
-               const char *fmt, ///< printf-style format command
-               va_list ap       ///< varargs argument list
-              );
+/** This procedure is functionally equivalent to psLogMsg(), except that
+ *  it takes a va_list as the message parameter, not a printf-style string.
+ *
+ */
+void psLogMsgV(
+    const char *name,                  ///< name of the log source
+    int myLevel,                       ///< severity level of this log message
+    const char *fmt,                   ///< printf-style format command
+    va_list ap                         ///< varargs argument list
+);
 
 ///< Status codes for log messages
 enum {
-    PS_LOG_ABORT = 0,
-    PS_LOG_ERROR,
-    PS_LOG_WARN,
-    PS_LOG_INFO
+    PS_LOG_ABORT = 0,                  ///< log message is a critical error, perform an abort after printing
+    PS_LOG_ERROR,                      ///< log message is an error, but don't abort
+    PS_LOG_WARN,                       ///< log message is a warning
+    PS_LOG_INFO                        ///< log message is informational only
 };
 
 ///< Destinations for log messages
 enum {
-    PS_LOG_NONE,
-    PS_LOG_TO_STDERR,
-    PS_LOG_TO_STDOUT
+    PS_LOG_NONE,                       ///< turn off logging
+    PS_LOG_TO_STDERR,                  ///< log to system's stderr
+    PS_LOG_TO_STDOUT                   ///< log to system's stdout
 };
 
Index: /trunk/psLib/src/sysUtils/psMemory.h
===================================================================
--- /trunk/psLib/src/sysUtils/psMemory.h	(revision 1447)
+++ /trunk/psLib/src/sysUtils/psMemory.h	(revision 1448)
@@ -1,5 +1,2 @@
-#if !defined(PS_MEMORY_H)
-#define PS_MEMORY_H
-
 /** @file  psMemory.h
  *
@@ -15,9 +12,12 @@
  *  @ingroup MemoryManagement
  *
- *  @version $Revision: 1.27 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2004-08-09 23:40:55 $
+ *  @version $Revision: 1.28 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2004-08-10 01:55:34 $
  *
  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
  */
+
+#if !defined(PS_MEMORY_H)
+#define PS_MEMORY_H
 
 #include <stdio.h>                     // needed for FILE
@@ -63,15 +63,15 @@
 typedef struct psMemBlock
 {
-    const void *startblock;     ///< initialised to p_psMEMMAGIC
-    struct psMemBlock* previousBlock;   ///< previous block in allocation list
-    struct psMemBlock* nextBlock;       ///< next block allocation list
-    psFreeFcn freeFcn;          ///< deallocator.  If NULL, use generic deallocation.
-    size_t userMemorySize;      ///< the size of the user-portion of the memory block
-    const psMemoryId id;        ///< a unique ID for this allocation
-    const char *file;           ///< set from __FILE__ in e.g. p_psAlloc
-    const int lineno;           ///< set from __LINE__ in e.g. p_psAlloc
-    pthread_mutex_t refCounterMutex;    ///< mutex to ensure exclusive access to reference counter
-    psReferenceCount refCounter;        ///< how many times pointer is referenced
-    const void *endblock;       ///< initialised to p_psMEMMAGIC
+    const void *startblock;            ///< initialised to p_psMEMMAGIC
+    struct psMemBlock* previousBlock;  ///< previous block in allocation list
+    struct psMemBlock* nextBlock;      ///< next block allocation list
+    psFreeFcn freeFcn;                 ///< deallocator.  If NULL, use generic deallocation.
+    size_t userMemorySize;             ///< the size of the user-portion of the memory block
+    const psMemoryId id;               ///< a unique ID for this allocation
+    const char *file;                  ///< set from __FILE__ in e.g. p_psAlloc
+    const int lineno;                  ///< set from __LINE__ in e.g. p_psAlloc
+    pthread_mutex_t refCounterMutex;   ///< mutex to ensure exclusive access to reference counter
+    psReferenceCount refCounter;       ///< how many times pointer is referenced
+    const void *endblock;              ///< initialised to p_psMEMMAGIC
 }
 psMemBlock;
@@ -82,6 +82,7 @@
  *  @ingroup memCallback
  */
-typedef psMemoryId(*psMemAllocateCallback) (const psMemBlock* ptr      ///< the psMemBlock just allocated
-                                           );
+typedef psMemoryId(*psMemAllocateCallback) (
+    const psMemBlock* ptr              ///< the psMemBlock just allocated
+);
 
 /** prototype of memory free callback used by memory functions
@@ -90,6 +91,7 @@
  *  @ingroup memCallback
  */
-typedef psMemoryId(*psMemFreeCallback) (const psMemBlock* ptr  ///< the psMemBlock being freed
-                                       );
+typedef psMemoryId(*psMemFreeCallback) (
+    const psMemBlock* ptr              ///< the psMemBlock being freed
+);
 
 /** prototype of a callback used in error conditions
@@ -100,9 +102,9 @@
  *  @ingroup memCallback
  */
-typedef void (*psMemProblemCallback) (const psMemBlock* ptr,   ///< the pointer to the problematic memory
-                                      // block.
-                                      const char *file, ///< the file in which the problem originated
-                                      int lineno        ///< the line number in which the problem originated
-                                     );
+typedef void (*psMemProblemCallback) (
+    const psMemBlock* ptr,             ///< the pointer to the problematic memory block.
+    const char *file,                  ///< the file in which the problem originated
+    int lineno                         ///< the line number in which the problem originated
+);
 
 /** prototype of a callback function used when memory runs out
@@ -114,6 +116,7 @@
  *  @ingroup memCallback
  */
-typedef void *(*psMemExhaustedCallback) (size_t size    // < the size of buffer required
-                                        );
+typedef void *(*psMemExhaustedCallback) (
+    size_t size                        ///< the size of buffer required
+);
 
 /** Memory allocation.  This operates much like malloc(), but is guaranteed to return a non-NULL value.
@@ -145,14 +148,16 @@
  */
 #ifdef DOXYGEN
-void *psRealloc(void *ptr       ///< Pointer to re-allocate
-                size_t size,    ///< Size required
-               );
-#else
-
-void *p_psRealloc(void *ptr,    ///< Pointer to re-allocate
-                  size_t size,  ///< Size required
-                  const char *file,     ///< File of call
-                  int lineno    ///< Line number of call
-                 );
+void *psRealloc(
+    void *ptr                          ///< Pointer to re-allocate
+    size_t size,                       ///< Size required
+);
+#else
+
+void *p_psRealloc(
+    void *ptr,                         ///< Pointer to re-allocate
+    size_t size,                       ///< Size required
+    const char *file,                  ///< File of call
+    int lineno                         ///< Line number of call
+);
 
 /// Memory re-allocation.  psRealloc sends file and line number to p_psRealloc.
@@ -166,12 +171,14 @@
  */
 #ifdef DOXYGEN
-void psFree(void *ptr,          ///< Pointer to free, if NULL, function returns immediately.
-           );
-#else
-
-void p_psFree(void *ptr,        ///< Pointer to free
-              const char *file, ///< File of call
-              int lineno        ///< Line number of call
-             );
+void psFree(
+    void *ptr,                         ///< Pointer to free, if NULL, function returns immediately.
+);
+#else
+
+void p_psFree(
+    void *ptr,                        ///< Pointer to free
+    const char *file,                 ///< File of call
+    int lineno                        ///< Line number of call
+);
 
 /// Free memory.  psFree sends file and line number to p_psFree.
@@ -194,8 +201,9 @@
  *  @ingroup memTracing
  */
-int psMemCheckLeaks(psMemoryId id0,     ///< don't list blocks with id < id0
-                    psMemBlock* ** arr, ///< pointer to array of pointers to leaked blocks, or NULL
-                    FILE * fd   ///< print list of leaks to fd (or NULL)
-                   );
+int psMemCheckLeaks(
+    psMemoryId id0,                    ///< don't list blocks with id < id0
+    psMemBlock* ** arr,                ///< pointer to array of pointers to leaked blocks, or NULL
+    FILE * fd                          ///< print list of leaks to fd (or NULL)
+);
 
 /** Check for memory corruption.  Scans all currently allocated memory buffers and checks for corruptions,
@@ -204,6 +212,7 @@
  *  @ingroup memTracing
  */
-int psMemCheckCorruption(bool abort_on_error    ///< Abort on detecting corruption?
-                        );
+int psMemCheckCorruption(
+    bool abort_on_error                ///< Abort on detecting corruption?
+);
 
 /** Return reference counter
@@ -211,6 +220,7 @@
  *  @ingroup memRefCount
  */
-psReferenceCount psMemGetRefCounter(void *vptr  ///< Pointer to get refCounter for
-                                   );
+psReferenceCount psMemGetRefCounter(
+    void *vptr                         ///< Pointer to get refCounter for
+);
 
 /** Increment reference counter and return the pointer
@@ -219,12 +229,14 @@
  */
 #ifdef DOXYGEN
-void *psMemIncrRefCounter(void *vptr    ///< Pointer to increment refCounter, and return
-                         );
-#else
-
-void *p_psMemIncrRefCounter(void *vptr, ///< Pointer to increment refCounter, and return
-                            const char *file,   ///< File of call
-                            int lineno  ///< Line number of call
-                           );
+void *psMemIncrRefCounter(
+    void *vptr                         ///< Pointer to increment refCounter, and return
+);
+#else
+
+void *p_psMemIncrRefCounter(
+    void *vptr,                        ///< Pointer to increment refCounter, and return
+    const char *file,                  ///< File of call
+    int lineno                         ///< Line number of call
+);
 
 #define psMemIncrRefCounter(vptr) p_psMemIncrRefCounter(vptr, __FILE__, __LINE__)
@@ -234,64 +246,127 @@
  *
  *  @ingroup memRefCount
- */
-#ifdef DOXYGEN
-void *psMemDecrRefCounter(void *vptr    ///< Pointer to decrement refCounter, and return
-                         );
-#else
-
-void *p_psMemDecrRefCounter(void *vptr, ///< Pointer to decrement refCounter, and return
-                            const char *file,   ///< File of call
-                            int lineno  ///< Line number of call
-                           );
+ *
+ *  @return void*    the pointer deremented in refCount, or NULL if pointer is 
+ *                   fully dereferenced.
+ */
+#ifdef DOXYGEN
+void* psMemDecrRefCounter(
+    void* vptr                         ///< Pointer to decrement refCounter, and return
+);
+#else
+
+void *p_psMemDecrRefCounter(
+    void *vptr,                        ///< Pointer to decrement refCounter, and return
+    const char *file,                  ///< File of call
+    int lineno                         ///< Line number of call
+);
 
 #define psMemDecrRefCounter(vptr) p_psMemDecrRefCounter(vptr, __FILE__, __LINE__)
 #endif
 
-/** Set callback for problems
- *  @ingroup memCallback
- */
-psMemProblemCallback psMemProblemCallbackSet(psMemProblemCallback func  ///< Function to run
-                                            );
-
-/** Set callback for out-of-memory
- *
- *  @ingroup memCallback
- */
-psMemExhaustedCallback psMemExhaustedCallbackSet(psMemExhaustedCallback func    ///< Function to run
-                                                );
+/** Set callback for problems.
+ *
+ *  At various occasions, the memory manager can check the state of the memory 
+ *  stack. If any of these checks discover that the memory stack is corrupted,
+ *  the psMemProblemCallback is called.
+ 
+ *  @ingroup memCallback
+ *
+ *  @return psMemProblemCallback       old psMemProblemCallback function
+ */
+psMemProblemCallback psMemProblemCallbackSet(
+    psMemProblemCallback func          ///< Function to run at memory problem detection
+);
+
+/** Set callback for out-of-memory.
+ *
+ *  If not enough memory is available to satisfy a request by psAlloc or 
+ *  psRealloc, these functions attempt to find an alternative solution by 
+ *  calling the psMemExhaustedCallback, a function which may be set by the 
+ *  programmer in appropriate circumstances, rather than immediately fail. 
+ *  The typical use of such a feature may be when a program needs a large 
+ *  chunk of memory to do an operation, but the exact size is not critical. 
+ *  This feature gives the programmer the opportunity to make a smaller 
+ *  request and try again, limiting the size of the operating buffer.
+ *
+ *  @ingroup memCallback
+ *
+ *  @return psMemExhaustedCallback     old psMemExhaustedCallback function
+ */
+psMemExhaustedCallback psMemExhaustedCallbackSet(
+    psMemExhaustedCallback func        ///< Function to run at memory exhaustion
+);
 
 /** Set call back for when a particular memory block is allocated
  *
- *  @ingroup memCallback
- */
-psMemAllocateCallback psMemAllocateCallbackSet(psMemAllocateCallback func       ///< Function to run
-                                              );
+ *  A private variable, p_psMemAllocateID, can be used to trace the allocation 
+ *  and freeing of specific memory blocks. If p_psMemAllocateID is set and a 
+ *  memory block with that ID is allocated, psMemAllocateCallback is called 
+ *  just before memory is returned to the calling function.
+ *
+ *  @ingroup memCallback
+ *
+ *  @return psMemAllocateCallback      old psMemAllocateCallback function
+ */
+psMemAllocateCallback psMemAllocateCallbackSet(
+    psMemAllocateCallback func       ///< Function to run at memory allocation of specific mem block
+);
 
 /** Set call back for when a particular memory block is freed
  *
- *  @ingroup memCallback
- */
-psMemFreeCallback psMemFreeCallbackSet(psMemFreeCallback func   ///< Function to run
-                                      );
+ *  A private variable, p_psMemFreeID, can be used to trace the freeing of 
+ *  specific memory blocks. If p_psMemFreeID is set and the memory block with 
+ *  the ID is about to be freed, the psMemFreeCallback callback is called just
+ *  before the memory block is freed.
+ *
+ *  @ingroup memCallback
+ *
+ *  @return psMemFreeCallback          old psMemFreeCallback function
+ */
+psMemFreeCallback psMemFreeCallbackSet(
+    psMemFreeCallback func             ///< Function to run at memory free of specific mem block
+);
 
 /** get next memory ID
  *
  *  @ingroup memCallback
+ *
+ *  @return psMemoryId                 the next memory ID to be used
  */
 psMemoryId psMemGetId(void);
 
-/** set p_psMemAllocateID to id
- *
- *  @ingroup memCallback
- */
-psMemoryId psMemAllocateCallbackSetID(psMemoryId id     ///< ID to set
-                                     );
+/** set p_psMemAllocateID to specific id
+ *
+ *  A private variable, p_psMemAllocateID, can be used to trace the allocation 
+ *  and freeing of specific memory blocks. If p_psMemAllocateID is set and a 
+ *  memory block with that ID is allocated, psMemAllocateCallback is called 
+ *  just before memory is returned to the calling function.
+ *
+ *  @ingroup memCallback
+ *
+ *  @return psMemoryId       
+ *
+ *  @see psMemAllocateCallbackSet    
+ */
+psMemoryId psMemAllocateCallbackSetID(
+    psMemoryId id                      ///< ID to set
+);
 
 /** set p_psMemFreeID to id
  *
- *  @ingroup memCallback
- */
-psMemoryId psMemFreeCallbackSetID(psMemoryId id ///< ID to set
-                                 );
+ *  A private variable, p_psMemFreeID, can be used to trace the freeing of 
+ *  specific memory blocks. If p_psMemFreeID is set and the memory block with 
+ *  the ID is about to be freed, the psMemFreeCallback callback is called just
+ *  before the memory block is freed.
+ *
+ *  @ingroup memCallback
+ *
+ *  @return psMemoryId                 the old p_psMemFreeID
+ *
+ *  @see psMemFreeCallbackSet
+ */
+psMemoryId psMemFreeCallbackSetID(
+    psMemoryId id                      ///< ID to set
+);
 
 //@} End of Memory Management Functions
@@ -306,12 +381,12 @@
 #pragma GCC poison malloc realloc calloc free
 #else
-#                define malloc(S)       _Pragma("error Use of malloc is not allowed.  Use psAlloc instead.")
-#                define realloc(P,S)    _Pragma("error Use of realloc is not allowed.  Use psRealloc instead.")
-#                define calloc(S)       _Pragma("error Use of calloc is not allowed.  Use psAlloc instead.")
-#                define free(P)         _Pragma("error Use of free is not allowed.  Use psFree instead.")
-#            endif
-#        endif
-
-#    endif
+#define malloc(S)       _Pragma("error Use of malloc is not allowed.  Use psAlloc instead.")
+#define realloc(P,S)    _Pragma("error Use of realloc is not allowed.  Use psRealloc instead.")
+#define calloc(S)       _Pragma("error Use of calloc is not allowed.  Use psAlloc instead.")
+#define free(P)         _Pragma("error Use of free is not allowed.  Use psFree instead.")
+#endif
+#endif
+
+#endif
 // doxygen skip
 
Index: /trunk/psLib/src/sysUtils/psString.h
===================================================================
--- /trunk/psLib/src/sysUtils/psString.h	(revision 1447)
+++ /trunk/psLib/src/sysUtils/psString.h	(revision 1448)
@@ -1,3 +1,2 @@
-
 /** @file  psString.h
  *
@@ -11,6 +10,6 @@
  *  @author Eric Van Alst, MHPCC
  *
- *  @version $Revision: 1.7 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2004-08-09 23:40:55 $
+ *  @version $Revision: 1.8 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2004-08-10 01:55:34 $
  *
  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -20,26 +19,7 @@
 #define PS_STRING_H
 
-/******************************************************************************/
 
-/*  DEFINE STATEMENTS                                                         */
-
-/******************************************************************************/
-
-/** This macro will convert the arguement to a quoted string */
+/** This macro will convert the argument to a quoted string */
 #define PS_STRING(S)  #S
-
-/******************************************************************************/
-
-/*  TYPE DEFINITIONS                                                          */
-
-/******************************************************************************/
-
-// None
-
-/*****************************************************************************/
-
-/* FUNCTION PROTOTYPES                                                       */
-
-/*****************************************************************************/
 
 // Doxygen group tags
@@ -54,11 +34,11 @@
  *  plus one and copy the input string to the newly allocated memory.
  *
- *  @return  char* Copy of input string
+ *  @return char*      Copy of input string
  *
  */
-
-char *psStringCopy(const char *str
-                   /**< Input string of characters to copy */
-                  );
+char *psStringCopy(
+    const char *str
+    /**< Input string of characters to copy */
+);
 
 /** Copies the input string up to the specified number of characters
@@ -78,10 +58,11 @@
 /*@null@*/
 
-char *psStringNCopy(const char *str,
-                    /**< Input string of characters to copy */
+char *psStringNCopy(
+    const char *str,
+    /**< Input string of characters to copy */
 
-                    int nChar
-                    /**< Number of bytes to allocate for string copy */
-                   );
+    int nChar
+    /**< Number of bytes to allocate for string copy */
+);
 
 /* @} */// Doxygen - End of SystemGroup Functions
Index: /trunk/psLib/src/sysUtils/psType.h
===================================================================
--- /trunk/psLib/src/sysUtils/psType.h	(revision 1447)
+++ /trunk/psLib/src/sysUtils/psType.h	(revision 1448)
@@ -11,6 +11,6 @@
 *  @author Ross Harman, MHPCC
 *
-*  @version $Revision: 1.19 $ $Name: not supported by cvs2svn $
-*  @date $Date: 2004-08-09 23:40:55 $
+*  @version $Revision: 1.20 $ $Name: not supported by cvs2svn $
+*  @date $Date: 2004-08-10 01:55:34 $
 *
 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -40,66 +40,66 @@
  */
 
-typedef uint8_t psU8;           ///< 8-bit unsigned int
-typedef uint16_t psU16;         ///< 16-bit unsigned int
-typedef uint32_t psU32;         ///< 32-bit unsigned int
-typedef uint64_t psU64;         ///< 64-bit unsigned int
-typedef int8_t psS8;            ///< 8-bit signed int
-typedef int16_t psS16;          ///< 16-bit signed int
-typedef int32_t psS32;          ///< 32-bit signed int
-typedef int64_t psS64;          ///< 64-bit signed int
-typedef float psF32;            ///< 32-bit floating point
-typedef double psF64;           ///< 64-bit floating point
-typedef complex float psC32;    ///< complex with 32-bit floating point Real and Imagary numbers
-typedef complex double psC64;   ///< complex with 64-bit floating point Real and Imagary numbers
-typedef void *psPTR;            ///< void pointer
+typedef uint8_t psU8;                  ///< 8-bit unsigned int
+typedef uint16_t psU16;                ///< 16-bit unsigned int
+typedef uint32_t psU32;                ///< 32-bit unsigned int
+typedef uint64_t psU64;                ///< 64-bit unsigned int
+typedef int8_t psS8;                   ///< 8-bit signed int
+typedef int16_t psS16;                 ///< 16-bit signed int
+typedef int32_t psS32;                 ///< 32-bit signed int
+typedef int64_t psS64;                 ///< 64-bit signed int
+typedef float psF32;                   ///< 32-bit floating point
+typedef double psF64;                  ///< 64-bit floating point
+typedef complex float psC32;           ///< complex with 32-bit floating point Real and Imagary numbers
+typedef complex double psC64;          ///< complex with 64-bit floating point Real and Imagary numbers
+typedef void *psPTR;                   ///< void pointer
 
 typedef enum {
-    PS_TYPE_S8 = 0x0101,        ///< Character.
-    PS_TYPE_S16 = 0x0102,                  ///< Short integer.
-    PS_TYPE_S32 = 0x0104,                  ///< Integer.
-    PS_TYPE_S64 = 0x0108,                  ///< Long integer.
-    PS_TYPE_U8 = 0x0301,                   ///< Unsigned character.
-    PS_TYPE_U16 = 0x0302,                  ///< Unsigned short integer.
-    PS_TYPE_U32 = 0x0304,                  ///< Unsigned integer.
-    PS_TYPE_U64 = 0x0308,                  ///< Unsigned long integer.
-    PS_TYPE_F32 = 0x0404,                  ///< Single-precision Floating point.
-    PS_TYPE_F64 = 0x0408,                  ///< Double-precision floating point.
-    PS_TYPE_C32 = 0x0808,                  ///< Complex numbers consisting of single-precision floating
-    // point.
-    PS_TYPE_C64 = 0x0810,                  ///< Complex numbers consisting of double-precision floating
-    // point.
-    PS_TYPE_PTR = 0x0000                   ///< Something else that's not supported for arithmetic.
+    PS_TYPE_S8 = 0x0101,               ///< Character.
+    PS_TYPE_S16 = 0x0102,              ///< Short integer.
+    PS_TYPE_S32 = 0x0104,              ///< Integer.
+    PS_TYPE_S64 = 0x0108,              ///< Long integer.
+    PS_TYPE_U8 = 0x0301,               ///< Unsigned character.
+    PS_TYPE_U16 = 0x0302,              ///< Unsigned short integer.
+    PS_TYPE_U32 = 0x0304,              ///< Unsigned integer.
+    PS_TYPE_U64 = 0x0308,              ///< Unsigned long integer.
+    PS_TYPE_F32 = 0x0404,              ///< Single-precision Floating point.
+    PS_TYPE_F64 = 0x0408,              ///< Double-precision floating point.
+    PS_TYPE_C32 = 0x0808,              ///< Complex numbers consisting of single-precision floating point.
+    PS_TYPE_C64 = 0x0810,              ///< Complex numbers consisting of double-precision floating point.
+    PS_TYPE_PTR = 0x0000               ///< Something else that's not supported for arithmetic.
 } psElemType;
 
-#define PS_TYPE_MASK PS_TYPE_U8        ///< the psElemType to use for mask image
-#define PS_TYPE_MASK_DATA U8           ///< the data member to use for mask image
-#define PS_TYPE_MASK_NAME "psU8"
-typedef psU8 psMaskType;        ///< the C datatype for a mask image
+#define PS_TYPE_MASK PS_TYPE_U8        /**< the psElemType to use for mask image */
+#define PS_TYPE_MASK_DATA U8           /**< the data member to use for mask image */
+#define PS_TYPE_MASK_NAME "psU8"       /**< the data type for mask as a string */
 
-#define PS_MIN_S8        INT8_MIN
-#define PS_MIN_S16       INT16_MIN
-#define PS_MIN_S32       INT32_MIN
-#define PS_MIN_S64       INT64_MIN
-#define PS_MIN_U8        0
-#define PS_MIN_U16       0
-#define PS_MIN_U32       0
-#define PS_MIN_U64       0
-#define PS_MIN_F32       -FLT_MAX
-#define PS_MIN_F64       -DBL_MAX
-#define PS_MIN_C32       -FLT_MAX
-#define PS_MIN_C64       -DBL_MAX
+typedef psU8 psMaskType;               ///< the C datatype for a mask image
 
-#define PS_MAX_S8        INT8_MAX
-#define PS_MAX_S16       INT16_MAX
-#define PS_MAX_S32       INT32_MAX
-#define PS_MAX_S64       INT64_MAX
-#define PS_MAX_U8        UINT8_MAX
-#define PS_MAX_U16       UINT16_MAX
-#define PS_MAX_U32       UINT32_MAX
-#define PS_MAX_U64       UINT64_MAX
-#define PS_MAX_F32       FLT_MAX
-#define PS_MAX_F64       DBL_MAX
-#define PS_MAX_C32       FLT_MAX
-#define PS_MAX_C64       DBL_MAX
+
+#define PS_MIN_S8        INT8_MIN      /**< minimum valid psS8 value */
+#define PS_MIN_S16       INT16_MIN     /**< minimum valid psS16 value */
+#define PS_MIN_S32       INT32_MIN     /**< minimum valid psS32 value */
+#define PS_MIN_S64       INT64_MIN     /**< minimum valid psS64 value */
+#define PS_MIN_U8        0             /**< minimum valid psU8 value */
+#define PS_MIN_U16       0             /**< minimum valid psU16 value */
+#define PS_MIN_U32       0             /**< minimum valid psU32 value */
+#define PS_MIN_U64       0             /**< minimum valid psU64 value */
+#define PS_MIN_F32       -FLT_MAX      /**< minimum valid psF32 value */
+#define PS_MIN_F64       -DBL_MAX      /**< minimum valid psF64 value */
+#define PS_MIN_C32       -FLT_MAX      /**< minimum valid real or imaginary psC32 value */
+#define PS_MIN_C64       -DBL_MAX      /**< minimum valid real or imaginary psC32 value */
+
+#define PS_MAX_S8        INT8_MAX      /**< maximum valid psS8 value */
+#define PS_MAX_S16       INT16_MAX     /**< maximum valid psS16 value */
+#define PS_MAX_S32       INT32_MAX     /**< maximum valid psS32 value */
+#define PS_MAX_S64       INT64_MAX     /**< maximum valid psS64 value */
+#define PS_MAX_U8        UINT8_MAX     /**< maximum valid psU8 value */
+#define PS_MAX_U16       UINT16_MAX    /**< maximum valid psU16 value */
+#define PS_MAX_U32       UINT32_MAX    /**< maximum valid psU32 value */
+#define PS_MAX_U64       UINT64_MAX    /**< maximum valid psU64 value */
+#define PS_MAX_F32       FLT_MAX       /**< maximum valid psF32 value */
+#define PS_MAX_F64       DBL_MAX       /**< maximum valid psF64 value */
+#define PS_MAX_C32       FLT_MAX       /**< maximum valid real or imaginary psC32 value */
+#define PS_MAX_C64       DBL_MAX       /**< maximum valid real or imaginary psC32 value */
 
 /// Macro to get the bad pixel reason code (stored as part of mask value)
