Index: trunk/psLib/src/sysUtils/psAbort.c
===================================================================
--- trunk/psLib/src/sysUtils/psAbort.c	(revision 1406)
+++ trunk/psLib/src/sysUtils/psAbort.c	(revision 1407)
@@ -1,2 +1,3 @@
+
 /** @file  psAbort.c
  *
@@ -9,6 +10,6 @@
  *  @author Eric Van Alst, MHPCC
  *   
- *  @version $Revision: 1.7 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2004-08-06 22:34:05 $
+ *  @version $Revision: 1.8 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2004-08-07 00:06:06 $
  *
  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -16,5 +17,7 @@
 
 /******************************************************************************/
+
 /*  INCLUDE FILES                                                             */
+
 /******************************************************************************/
 #include <stdarg.h>
@@ -24,5 +27,7 @@
 
 /******************************************************************************/
+
 /*  DEFINE STATEMENTS                                                         */
+
 /******************************************************************************/
 
@@ -30,5 +35,7 @@
 
 /******************************************************************************/
+
 /*  TYPE DEFINITIONS                                                          */
+
 /******************************************************************************/
 
@@ -36,5 +43,7 @@
 
 /*****************************************************************************/
+
 /*  GLOBAL VARIABLES                                                         */
+
 /*****************************************************************************/
 
@@ -42,5 +51,7 @@
 
 /*****************************************************************************/
+
 /*  FILE STATIC VARIABLES                                                    */
+
 /*****************************************************************************/
 
@@ -48,5 +59,7 @@
 
 /*****************************************************************************/
+
 /*  FUNCTION IMPLEMENTATION - LOCAL                                          */
+
 /*****************************************************************************/
 
@@ -54,10 +67,12 @@
 
 /*****************************************************************************/
+
 /* FUNCTION IMPLEMENTATION - PUBLIC                                          */
+
 /*****************************************************************************/
 
-void psAbort(const char *name, const char *fmt,... )
+void psAbort(const char *name, const char *fmt, ...)
 {
-    va_list    argPtr;     // variable list arguement pointer
+    va_list argPtr;             // variable list arguement pointer
 
     // Get the variable list parameters to pass to logging function
@@ -73,3 +88,2 @@
     abort();
 }
-
Index: trunk/psLib/src/sysUtils/psAbort.h
===================================================================
--- trunk/psLib/src/sysUtils/psAbort.h	(revision 1406)
+++ trunk/psLib/src/sysUtils/psAbort.h	(revision 1407)
@@ -1,2 +1,3 @@
+
 /** @file  psAbort.h
  *
@@ -11,6 +12,6 @@
  *  @author Eric Van Alst, MHPCC
  *
- *  @version $Revision: 1.4 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2004-06-10 01:58:06 $
+ *  @version $Revision: 1.5 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2004-08-07 00:06:06 $
  *
  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -18,8 +19,8 @@
 
 #ifndef PS_ABORT_H
-#define PS_ABORT_H
-
+#    define PS_ABORT_H
 
 // Doxygen grouping tags
+
 /** @addtogroup ErrorHandling
  *  @{
@@ -36,12 +37,10 @@
  *
  */
-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
+/* @} */// Doxygen - End of SystemGroup Functions
 
 #endif
-
Index: trunk/psLib/src/sysUtils/psError.c
===================================================================
--- trunk/psLib/src/sysUtils/psError.c	(revision 1406)
+++ trunk/psLib/src/sysUtils/psError.c	(revision 1407)
@@ -1,2 +1,3 @@
+
 /** @file  psError.c
  *
@@ -10,6 +11,6 @@
  *  @author Eric Van Alst, MHPCC
  *   
- *  @version $Revision: 1.9 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2004-08-06 22:34:05 $
+ *  @version $Revision: 1.10 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2004-08-07 00:06:06 $
  *
  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -17,5 +18,7 @@
 
 /******************************************************************************/
+
 /*  INCLUDE FILES                                                             */
+
 /******************************************************************************/
 #include <stdarg.h>
@@ -24,5 +27,7 @@
 
 /******************************************************************************/
+
 /*  DEFINE STATEMENTS                                                         */
+
 /******************************************************************************/
 
@@ -30,5 +35,7 @@
 
 /******************************************************************************/
+
 /*  TYPE DEFINITIONS                                                          */
+
 /******************************************************************************/
 
@@ -36,5 +43,7 @@
 
 /*****************************************************************************/
+
 /*  GLOBAL VARIABLES                                                         */
+
 /*****************************************************************************/
 
@@ -42,5 +51,7 @@
 
 /*****************************************************************************/
+
 /*  FILE STATIC VARIABLES                                                    */
+
 /*****************************************************************************/
 
@@ -48,5 +59,7 @@
 
 /*****************************************************************************/
+
 /*  FUNCTION IMPLEMENTATIONS - LOCAL                                         */
+
 /*****************************************************************************/
 
@@ -54,12 +67,14 @@
 
 /*****************************************************************************/
+
 /* FUNCTION IMPLEMENTATIONS - PUBLIC                                         */
+
 /*****************************************************************************/
 
-void psError(const char *name,const char *fmt, ...)
+void psError(const char *name, const char *fmt, ...)
 {
-    va_list    argPtr;        // variable list arguement pointer
+    va_list argPtr;             // variable list arguement pointer
 
-    // Get the variable list parameters  to pass to logging function
+    // Get the variable list parameters to pass to logging function
     va_start(argPtr, fmt);
 
@@ -70,3 +85,2 @@
     va_end(argPtr);
 }
-
Index: trunk/psLib/src/sysUtils/psError.h
===================================================================
--- trunk/psLib/src/sysUtils/psError.h	(revision 1406)
+++ trunk/psLib/src/sysUtils/psError.h	(revision 1407)
@@ -1,2 +1,3 @@
+
 /** @file  psError.h
  *
@@ -12,6 +13,6 @@
  *  @author Eric Van Alst, MHPCC
  *
- *  @version $Revision: 1.4 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2004-06-10 01:58:06 $
+ *  @version $Revision: 1.5 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2004-08-07 00:06:06 $
  *
  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -19,5 +20,5 @@
 
 #ifndef PS_ERROR_H
-#define PS_ERROR_H
+#    define PS_ERROR_H
 
 /** @addtogroup ErrorHandling
@@ -34,12 +35,10 @@
  *
  */
-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
+/* @} */// End of SysUtils Functions
 
 #endif
-
Index: trunk/psLib/src/sysUtils/psHash.c
===================================================================
--- trunk/psLib/src/sysUtils/psHash.c	(revision 1406)
+++ trunk/psLib/src/sysUtils/psHash.c	(revision 1407)
@@ -1,2 +1,3 @@
+
 /** @file  psHash.c
 *
@@ -10,6 +11,6 @@
 *  @author George Gusciora, MHPCC
 *
-*  @version $Revision: 1.15 $ $Name: not supported by cvs2svn $
-*  @date $Date: 2004-08-06 22:34:05 $
+*  @version $Revision: 1.16 $ $Name: not supported by cvs2svn $
+*  @date $Date: 2004-08-07 00:06:06 $
 *
 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -25,10 +26,9 @@
 #include "psAbort.h"
 
-static psHashBucket *hashBucketAlloc( const char *key, void *data, psHashBucket *next );
-static void hashBucketFree( psHashBucket *bucket );
-static void *doHashWork( psHash* table, const char* key, void* data, bool remove
-                           )
-    ;
-static void hashFree( psHash *table );
+static psHashBucket *hashBucketAlloc(const char *key, void *data, psHashBucket * next);
+static void hashBucketFree(psHashBucket * bucket);
+static void *doHashWork(psHash * table, const char *key, void *data, bool remove
+                           );
+static void hashFree(psHash * table);
 
 /******************************************************************************
@@ -40,27 +40,26 @@
     The linked list
  *****************************************************************************/
-psList *psHashKeyList( psHash *table )
-{
-    int i = 0;                          // Loop index variable
+psList *psHashKeyList(psHash * table)
+{
+    int i = 0;                  // Loop index variable
     psList *myLinkList = NULL;  // The output data structure
-    psHashBucket *ptr = NULL;           // Used to step thru linked list.
-
-    if ( table == NULL ) {
+    psHashBucket *ptr = NULL;   // Used to step thru linked list.
+
+    if (table == NULL) {
         return NULL;
     }
-
     // Create the linked list
-    myLinkList = psListAlloc( NULL );
+    myLinkList = psListAlloc(NULL);
 
     // Loop through every bucket in the hash table.  If that bucket is not
     // NULL, then add the bucket's key to the linked list.
-    for ( i = 0;i < table->nbucket;i++ ) {
-        if ( table->buckets[ i ] != NULL ) {
+    for (i = 0; i < table->nbucket; i++) {
+        if (table->buckets[i] != NULL) {
             // Since a bucket contains a linked list of keys/data, we must
             // step trough each key in that linked list:
 
-            ptr = table->buckets[ i ];
-            while ( ptr != NULL ) {
-                psListAdd( myLinkList, ptr->key, PS_LIST_HEAD );
+            ptr = table->buckets[i];
+            while (ptr != NULL) {
+                psListAdd(myLinkList, ptr->key, PS_LIST_HEAD);
                 ptr = ptr->next;
             }
@@ -69,8 +68,6 @@
 
     // Return the linked list
-    return ( myLinkList );
-}
-
-
+    return (myLinkList);
+}
 
 /******************************************************************************
@@ -84,24 +81,22 @@
     the new hash bucket.
  *****************************************************************************/
-static psHashBucket *hashBucketAlloc( const char *key,
-                                      void *data,
-                                      psHashBucket *next )
-{
-    if ( key == NULL ) {
-        psAbort( __func__, "psHashBucket() called with NULL key." );
-    }
-
+static psHashBucket *hashBucketAlloc(const char *key, void *data, psHashBucket * next)
+{
+    if (key == NULL) {
+        psAbort(__func__, "psHashBucket() called with NULL key.");
+    }
     // Allocate memory for the new hash bucket.
-    psHashBucket *bucket = psAlloc( sizeof( psHashBucket ) );
-    p_psMemSetDeallocator( bucket, ( psFreeFcn ) hashBucketFree );
+    psHashBucket *bucket = psAlloc(sizeof(psHashBucket));
+
+    p_psMemSetDeallocator(bucket, (psFreeFcn) hashBucketFree);
 
     // Initialize the bucket.
-    bucket->key = psStringCopy( key );
-
-    if ( data == NULL ) {
+    bucket->key = psStringCopy(key);
+
+    if (data == NULL) {
         // NOTE: Should we flag a warning message?
         bucket->data = NULL;
     } else {
-        bucket->data = psMemIncrRefCounter( data );
+        bucket->data = psMemIncrRefCounter(data);
     }
 
@@ -110,5 +105,4 @@
     return bucket;
 }
-
 
 /******************************************************************************
@@ -120,19 +114,17 @@
     NONE
  *****************************************************************************/
-static void hashBucketFree( psHashBucket *bucket )
-{
-    if ( bucket == NULL ) {
-        return ;
-    }
-
+static void hashBucketFree(psHashBucket * bucket)
+{
+    if (bucket == NULL) {
+        return;
+    }
     // A bucket is actually a linked list of buckets.  We recursively step
     // through that linked list, free each bucket.
-    psFree( bucket->next );
-
-    psFree( bucket->key );
-
-    psFree( bucket->data );
-}
-
+    psFree(bucket->next);
+
+    psFree(bucket->key);
+
+    psFree(bucket->data);
+}
 
 /******************************************************************************
@@ -144,21 +136,23 @@
     The new hash table.
  *****************************************************************************/
-psHash *psHashAlloc( int nbucket )   // initial number of buckets
-{
-    int i = 0;   // loop index variable
+psHash *psHashAlloc(int nbucket)        // initial number of buckets
+{
+    int i = 0;                  // loop index variable
+
     // Create the new hash table.
-    psHash *table = psAlloc( sizeof( psHash ) );
-    p_psMemSetDeallocator( table, ( psFreeFcn ) hashFree );
+    psHash *table = psAlloc(sizeof(psHash));
+
+    p_psMemSetDeallocator(table, (psFreeFcn) hashFree);
 
     // Allocate memory for the buckets.
-    table->buckets = psAlloc( nbucket * sizeof( psHashBucket * ) );
+    table->buckets = psAlloc(nbucket * sizeof(psHashBucket *));
     table->nbucket = nbucket;
 
-    psTrace( "utils.hash", 1, "Creating %d-element hash table\n", nbucket );
+    psTrace("utils.hash", 1, "Creating %d-element hash table\n", nbucket);
 
     // Initialize all buckets to NULL.
-    for ( i = 0; i < nbucket; i++ )
+    for (i = 0; i < nbucket; i++)
     {
-        table->buckets[ i ] = NULL;
+        table->buckets[i] = NULL;
     }
 
@@ -166,6 +160,4 @@
     return table;
 }
-
-
 
 /******************************************************************************
@@ -179,24 +171,23 @@
     NONE
  *****************************************************************************/
-static void hashFree( psHash *table )
-{
-    int i = 0;                          // Loop index variable.
-
-    if ( table == NULL ) {
-        return ;
-    }
-
+static void hashFree(psHash * table)
+{
+    int i = 0;                  // Loop index variable.
+
+    if (table == NULL) {
+        return;
+    }
     // Loop through each bucket in the hash table.  If that bucket is not
     // NULL, then free the bucket via a function call to hashBucketFree();
-    for ( i = 0; i < table->nbucket; i++ ) {
+    for (i = 0; i < table->nbucket; i++) {
 
         // A bucket is composed of a linked list of buckets.
-        if ( table->buckets[ i ] != NULL ) {
-            psFree( table->buckets[ i ] );
+        if (table->buckets[i] != NULL) {
+            psFree(table->buckets[i]);
         }
     }
 
     // Free the bucket structure, then the hash table.
-    psFree( table->buckets );
+    psFree(table->buckets);
 }
 
@@ -220,12 +211,14 @@
 there is little common code between those functions.
   *****************************************************************************/
-static void *doHashWork( psHash *table, const char *key, void *data, bool remove
+static void *doHashWork(psHash * table, const char *key, void *data, bool remove
                            )
 {
-    long int hash = 1;                  // This will contain an integer value
+    long int hash = 1;          // This will contain an integer value
+
     // "hashed" from the key.
-    char *tmpchar = NULL;               // Used in computing the hash function.
-    psHashBucket *ptr = NULL;           // Used to retrieve the hash bucket.
-    psHashBucket *optr = NULL;          // "original pointer": used to step
+    char *tmpchar = NULL;       // Used in computing the hash function.
+    psHashBucket *ptr = NULL;   // Used to retrieve the hash bucket.
+    psHashBucket *optr = NULL;  // "original pointer": used to step
+
     // thru the linked list for a bucket.
 
@@ -233,30 +226,28 @@
     // function, but I'm checking it anyway since future coders might change
     // the way this procedure is called.
-    if ( ( table == NULL ) || ( key == NULL ) ) {
-
-        psAbort( __func__, "psHashRemove() called with NULL key or table." );
-    }
-
+    if ((table == NULL) || (key == NULL)) {
+
+        psAbort(__func__, "psHashRemove() called with NULL key or table.");
+    }
     // NOTE: This is the originally supplied hash function.
-    //    for (int i = 0, len = strlen(key); i < len; i++) {
-    //        hash = (hash << 1) ^ key[i];
-    //    }
-    //    hash &= (table->nbucket - 1);
+    // for (int i = 0, len = strlen(key); i < len; i++) {
+    // hash = (hash << 1) ^ key[i];
+    // }
+    // hash &= (table->nbucket - 1);
 
     // This hash algorithm is from Sedgewick.  NOTE: must reread to ensure that
     // the size of the hash table is not required to be a prime number.
-    tmpchar = ( char * ) key;
-    for ( hash = 0; *tmpchar != '\0'; tmpchar++ ) {
-        hash = ( 64 * hash + *tmpchar ) % ( table->nbucket );
+    tmpchar = (char *)key;
+    for (hash = 0; *tmpchar != '\0'; tmpchar++) {
+        hash = (64 * hash + *tmpchar) % (table->nbucket);
     }
 
     // NOTE: This should not be necessary, but for now, I'm checking bounds
     // anyway.
-    if ( ( hash < 0 ) || ( hash >= table->nbucket ) ) {
-        psAbort( __func__, "Internal hash function out of range (%d)", hash );
-    }
-
+    if ((hash < 0) || (hash >= table->nbucket)) {
+        psAbort(__func__, "Internal hash function out of range (%d)", hash);
+    }
     // ptr will have the correct hash bucket.
-    ptr = table->buckets[ hash ];
+    ptr = table->buckets[hash];
 
     // We know the correct hash bucket, now we need to know what to do.
@@ -264,45 +255,46 @@
     // or a remove operation on the hash table.
 
-    if ( data == NULL ) {
-        if ( remove
-               ) {
-                // We search through the linked list for this bucket in
-                // the hash table and look for an entry for this key.
-
+    if (data == NULL) {
+        if (remove
+           ) {
+            // We search through the linked list for this bucket in
+            // the hash table and look for an entry for this key.
+
+            optr = ptr;
+            while (ptr != NULL) {
+                // Dtermine if this entry holds the correct key.
+                if (strcmp(key, ptr->key) == 0) {
+                    // The following lines of code are fairly standard ways
+                    // of removing an item from a single-linked list.
+
+                    void *data = ptr->data;
+
+                    optr->next = ptr->next;
+                    if (ptr == table->buckets[hash]) {
+                        table->buckets[hash] = ptr->next;
+                    }
+
+                    psFree(ptr);
+
+                    // By definition, the data associated with that key
+                    // must be returned, not freed.
+                    return data;
+                }
                 optr = ptr;
-                while ( ptr != NULL ) {
-                    // Dtermine if this entry holds the correct key.
-                    if ( strcmp( key, ptr->key ) == 0 ) {
-                        // The following lines of code are fairly standard ways
-                        // of removing an item from a single-linked list.
-
-                        void * data = ptr->data;
-                        optr->next = ptr->next;
-                        if ( ptr == table->buckets[ hash ] ) {
-                            table->buckets[ hash ] = ptr->next;
-                        }
-
-                        psFree( ptr );
-
-                        // By definition, the data associated with that key
-                        // must be returned, not freed.
-                        return data;
-                    }
-                    optr = ptr;
-                    ptr = ptr->next;
-                }
-                return NULL;   // not in hash
+                ptr = ptr->next;
             }
+            return NULL;                   // not in hash
+        }
         else {
             // If we get here, then a retrieve operation is requested.  So,
             // we step trough the linked list at this bucket, and return the
             // data once we find it, or return NULL if we don't.
-            while ( ptr != NULL ) {
-                if ( strcmp( key, ptr->key ) == 0 ) {
+            while (ptr != NULL) {
+                if (strcmp(key, ptr->key) == 0) {
                     return ptr->data;
                 }
                 ptr = ptr->next;
             }
-            return NULL;   // not in hash
+            return NULL;                   // not in hash
         }
     } else {
@@ -312,10 +304,9 @@
         // the hash table and look for a duplicate entry for this key.
 
-        while ( ptr != NULL ) {
-            if ( strcmp( key, ptr->key ) == 0 ) {
+        while (ptr != NULL) {
+            if (strcmp(key, ptr->key) == 0) {
                 // We have found this key in the hash table.
 
-                psTrace( "utils.hash.insert", 3, "Replacing data for %s\n",
-                         key );
+                psTrace("utils.hash.insert", 3, "Replacing data for %s\n", key);
 
                 // NOTE: I have changed this behavior from the originally
@@ -323,7 +314,7 @@
                 // the new data was not inserted into the hash table.
 
-                psFree( ptr->data );
-
-                ptr->data = psMemIncrRefCounter( data );
+                psFree(ptr->data);
+
+                ptr->data = psMemIncrRefCounter(data);
                 return data;
             }
@@ -333,7 +324,5 @@
         // table.  So, we insert this data at the head of that linked list.
 
-        table->buckets[ hash ] = hashBucketAlloc( key,
-                                 data,
-                                 table->buckets[ hash ] );
+        table->buckets[hash] = hashBucketAlloc(key, data, table->buckets[hash]);
         return data;
     }
@@ -351,17 +340,17 @@
     boolean value defining success or failure
  *****************************************************************************/
-bool psHashAdd( psHash *table, const char *key, void *data )
-{
-    if ( table == NULL ) {
-        psAbort( __func__, "psHashInsert() called with NULL hash table." );
-    }
-    if ( key == NULL ) {
-        psAbort( __func__, "psHashInsert() called with NULL key." );
-    }
-    if ( data == NULL ) {
-        psAbort( __func__, "psHashLookup() called with NULL data." );
-    }
-
-    return ( doHashWork( table, key, data, 0 ) != NULL );
+bool psHashAdd(psHash * table, const char *key, void *data)
+{
+    if (table == NULL) {
+        psAbort(__func__, "psHashInsert() called with NULL hash table.");
+    }
+    if (key == NULL) {
+        psAbort(__func__, "psHashInsert() called with NULL key.");
+    }
+    if (data == NULL) {
+        psAbort(__func__, "psHashLookup() called with NULL data.");
+    }
+
+    return (doHashWork(table, key, data, 0) != NULL);
 }
 
@@ -377,16 +366,15 @@
     The data associated with that key.
  *****************************************************************************/
-void *psHashLookup( psHash *table,     // table to lookup key in
-                    const char *key )   // key to lookup
-{
-    if ( table == NULL ) {
-        psAbort( __func__, "psHashLookup() called with NULL hash table." );
-    }
-    if ( key == NULL ) {
-        psAbort( __func__, "psHashLookup() called with NULL key." );
-    }
-
-
-    return doHashWork( table, key, NULL, 0 );
+void *psHashLookup(psHash * table,      // table to lookup key in
+                   const char *key)     // key to lookup
+{
+    if (table == NULL) {
+        psAbort(__func__, "psHashLookup() called with NULL hash table.");
+    }
+    if (key == NULL) {
+        psAbort(__func__, "psHashLookup() called with NULL key.");
+    }
+
+    return doHashWork(table, key, NULL, 0);
 }
 
@@ -401,19 +389,19 @@
     boolean value defining success or failure
  *****************************************************************************/
-bool psHashRemove( psHash *table, const char *key )
-{
-    void * data = NULL;
+bool psHashRemove(psHash * table, const char *key)
+{
+    void *data = NULL;
     bool retVal = false;
 
-    if ( table == NULL ) {
-        psAbort( __func__, "psHashRemove() called with NULL hash table." );
-    }
-    if ( key == NULL ) {
-        psAbort( __func__, "psHashRemove() called with NULL key." );
-    }
-
-    data = doHashWork( table, key, NULL, 1 );
-    if ( data != NULL ) {
-        psFree( data );
+    if (table == NULL) {
+        psAbort(__func__, "psHashRemove() called with NULL hash table.");
+    }
+    if (key == NULL) {
+        psAbort(__func__, "psHashRemove() called with NULL key.");
+    }
+
+    data = doHashWork(table, key, NULL, 1);
+    if (data != NULL) {
+        psFree(data);
         retVal = true;
     } else {
Index: trunk/psLib/src/sysUtils/psHash.h
===================================================================
--- trunk/psLib/src/sysUtils/psHash.h	(revision 1406)
+++ trunk/psLib/src/sysUtils/psHash.h	(revision 1407)
@@ -1,2 +1,3 @@
+
 /** @file  psHash.h
  *  @brief Contains support for basic hashing functions.
@@ -10,62 +11,63 @@
  *  @author George Gusciora, MHPCC
  *   
- *  @version $Revision: 1.18 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2004-08-06 22:34:05 $
+ *  @version $Revision: 1.19 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2004-08-07 00:06:06 $
  *
  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
  */
 #if !defined(PS_HASH_H)
-#define PS_HASH_H
+#    define PS_HASH_H
 
 /** \addtogroup HashTable
  *  \{
  */
-#include<stdbool.h>
+#    include<stdbool.h>
 
-#include "psList.h"
+#    include "psList.h"
 
 /** A bucket that holds an item of data. */
 typedef struct psHashBucket
 {
-    char *key;                          ///< key for this item of data
-    void *data;                         ///< the data itself
-    struct psHashBucket *next;          ///< list of other possible keys
+    char *key;                  // /< key for this item of data
+    void *data;                 // /< the data itself
+    struct psHashBucket *next;  // /< list of other possible keys
 }
 psHashBucket;
 
 //typedef struct HashTable psHash; ///< Opaque type for a hash table
+
 /** The hash-table itself. */
 typedef struct psHash
 {
-    int nbucket;                        ///< Number of buckets in hash table.
-    psHashBucket **buckets;             ///< The bucket data.
+    int nbucket;                // /< Number of buckets in hash table.
+    psHashBucket **buckets;     // /< The bucket data.
 }
 psHash;
 
 /// Allocate hash buckets in table.
-psHash *psHashAlloc(int nbucket       ///< The number of buckets to allocate.
+psHash *psHashAlloc(int nbucket // /< The number of buckets to allocate.
                    );
 
 /// Insert entry into table.
-bool psHashAdd(psHash *table,               ///< table to insert in
-               const char *key,             ///< key to use
-               void *data                   ///< data to insert
+bool psHashAdd(psHash * table,  // /< table to insert in
+               const char *key, // /< key to use
+               void *data       // /< data to insert
               );
 
 /// Lookup key in table.
-void *psHashLookup(psHash *table,      ///< table to lookup key in
-                   const char *key     ///< key to lookup
+void *psHashLookup(psHash * table,      // /< table to lookup key in
+                   const char *key      // /< key to lookup
                   );
 
 /// Remove key from table.
-bool psHashRemove(psHash *table,      ///< table to lookup key in
-                  const char *key     ///< key to lookup
+bool psHashRemove(psHash * table,       // /< table to lookup key in
+                  const char *key       // /< key to lookup
                  );
 
 /// List all keys in table.
-psList *psHashKeyList(psHash *table  ///< table to list keys from.
+psList *psHashKeyList(psHash * table    // /< table to list keys from.
                      );
 
-/* \} */ // End of DataGroup Functions
+/* \} */// End of DataGroup Functions
 
 #endif
Index: trunk/psLib/src/sysUtils/psLogMsg.c
===================================================================
--- trunk/psLib/src/sysUtils/psLogMsg.c	(revision 1406)
+++ trunk/psLib/src/sysUtils/psLogMsg.c	(revision 1407)
@@ -1,2 +1,3 @@
+
 /** @file  psLogMsg.c
  *  @brief Procedures for logging messages.
@@ -11,6 +12,6 @@
  *  @author George Gusciora, MHPCC
  *
- *  @version $Revision: 1.23 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2004-08-06 22:34:05 $
+ *  @version $Revision: 1.24 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2004-08-07 00:06:06 $
  *
  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -44,11 +45,11 @@
 
 #define MAX_LOG_LINE_LENGTH 128
-static FILE* logDest = (FILE*)1;       // flag to initialize to stderr before using.
-static int globalLogLevel = PS_LOG_INFO; // log all messages at this or above
-static bool logTime = true;            // Flag to include time info
-static bool logHost = true;            // Flag to include host info
-static bool logLevel = true;           // Flag to include level info
-static bool logName = true;            // Flag to include name info
-static bool logMsg = true;             // Flag to include message info
+static FILE *logDest = (FILE *) 1;      // flag to initialize to stderr before using.
+static int globalLogLevel = PS_LOG_INFO;        // log all messages at this or above
+static bool logTime = true;     // Flag to include time info
+static bool logHost = true;     // Flag to include host info
+static bool logLevel = true;    // Flag to include level info
+static bool logName = true;     // Flag to include name info
+static bool logMsg = true;      // Flag to include message info
 
 /*****************************************************************************
@@ -67,9 +68,7 @@
 
     if ((level < MIN_LOG_LEVEL) || (level > MAX_LOG_LEVEL)) {
-        psLogMsg("logmsg", PS_LOG_WARN,
-                 "Attempt to set invalid logMsg level: %d", level);
+        psLogMsg("logmsg", PS_LOG_WARN, "Attempt to set invalid logMsg level: %d", level);
         level = (level < MIN_LOG_LEVEL) ? MIN_LOG_LEVEL : MAX_LOG_LEVEL;
     }
-
     // Set new global log level
     globalLogLevel = level;
@@ -78,5 +77,4 @@
     return oldLevel;
 }
-
 
 /*****************************************************************************
@@ -91,5 +89,5 @@
  An integer specifying the old log destination.
  *****************************************************************************/
-int psLogSetDestination(const char* dest)
+int psLogSetDestination(const char *dest)
 {
     char protocol[5];
@@ -97,9 +95,9 @@
 
     // if logDest has not been initialized, do so before using it
-    if (logDest==(FILE*)1) {
+    if (logDest == (FILE *) 1) {
         logDest = stderr;
     }
 
-    if (dest == NULL || strcmp(dest,"none")==0) {
+    if (dest == NULL || strcmp(dest, "none") == 0) {
         if (logDest != NULL && logDest != stderr && logDest != stdout) {
             fclose(logDest);
@@ -109,11 +107,11 @@
     }
 
-    if (sscanf(dest,"%4s:%256s",protocol,location) < 2) {
-        psError(__func__,"The specified destination, %s, is malformed.", dest);
+    if (sscanf(dest, "%4s:%256s", protocol, location) < 2) {
+        psError(__func__, "The specified destination, %s, is malformed.", dest);
         return 1;
     }
 
-    if (strcmp(protocol,"dest") == 0) {
-        if (strcmp(location,"stderr") == 0) {
+    if (strcmp(protocol, "dest") == 0) {
+        if (strcmp(location, "stderr") == 0) {
             if (logDest != NULL && logDest != stderr && logDest != stdout) {
                 fclose(logDest);
@@ -122,5 +120,5 @@
             return 0;
         }
-        if (strcmp(location,"stdout") == 0) {
+        if (strcmp(location, "stdout") == 0) {
             if (logDest != NULL && logDest != stderr && logDest != stdout) {
                 fclose(logDest);
@@ -129,21 +127,21 @@
             return 0;
         }
-        psError(__func__,"The location, %s, for protocol 'dest' is invalid.",location);
+        psError(__func__, "The location, %s, for protocol 'dest' is invalid.", location);
         return 1;
-    } else
-        if (strcmp(protocol,"file") == 0) {
-            FILE* file = fopen(location,"w");
-            if (file == NULL) {
-                psError(__func__,"Could not open file '%s' for output.",location);
-                return 1;
-            }
-            if (logDest != NULL && logDest != stderr && logDest != stdout) {
-                fclose(logDest);
-            }
-            logDest = file;
-            return 0;
-        }
-
-    psError(__func__,"Do not know how to handle the protocol '%s'.",protocol);
+    } else if (strcmp(protocol, "file") == 0) {
+        FILE *file = fopen(location, "w");
+
+        if (file == NULL) {
+            psError(__func__, "Could not open file '%s' for output.", location);
+            return 1;
+        }
+        if (logDest != NULL && logDest != stderr && logDest != stdout) {
+            fclose(logDest);
+        }
+        logDest = file;
+        return 0;
+    }
+
+    psError(__func__, "Do not know how to handle the protocol '%s'.", protocol);
     return 1;
 }
@@ -181,5 +179,4 @@
         fmt = "THLNM";
     }
-
     // Step through each character in the format string.  For each letter
     // in that string, set/unset the appropriate logging.
@@ -214,15 +211,12 @@
 
     if (!logMsg) {
-        psTrace("utils.logMsg", 1,
-                "You must at least log error messages (You chose \"%s\")",
-                fmt);
-    }
-}
-
-
-
-#if !defined(HOST_NAME_MAX)  // should be in limits.h
-#  define HOST_NAME_MAX 256
+        psTrace("utils.logMsg", 1, "You must at least log error messages (You chose \"%s\")", fmt);
+    }
+}
+
+#if !defined(HOST_NAME_MAX)                // should be in limits.h
+#    define HOST_NAME_MAX 256
 #endif
+
 /*****************************************************************************
     psVLogMsg(): This routine sends the message, which is a printf style
@@ -239,29 +233,25 @@
  NULL.
  *****************************************************************************/
-void psLogMsgV(const char *name,
-               int level,
-               const char *fmt,
-               va_list ap)
-{
-    static int first = 1;               // Flag for calling gethostname()
+void psLogMsgV(const char *name, int level, const char *fmt, va_list ap)
+{
+    static int first = 1;       // Flag for calling gethostname()
     static char hostname[HOST_NAME_MAX + 1];
+
     // Buffer for hostname.
-    char clevel=0;                      // letter-name for level
-    char head[MAX_LOG_LINE_LENGTH+2];   // the added two are for the ending | and \0
-    char *head_ptr = head;              // where we've got to in head
+    char clevel = 0;            // letter-name for level
+    char head[MAX_LOG_LINE_LENGTH + 2]; // the added two are for the ending | and \0
+    char *head_ptr = head;      // where we've got to in head
     int maxLength = MAX_LOG_LINE_LENGTH;
-    time_t clock = time(NULL);          // The current time.
+    time_t clock = time(NULL);  // The current time.
     struct tm *utc = gmtime(&clock);    // The current gm time.
 
     // if logDest has not been initialized, do so before using it
-    if (logDest==(FILE*)1) {
+    if (logDest == (FILE *) 1) {
         logDest = stderr;
     }
-
     // If logging is off, or if the level is too high, return immediately.
     if ((level > globalLogLevel) || (logDest == NULL)) {
         return;
     }
-
     // If I have not been here yet, determine my hostname and save it.
     if (first) {
@@ -297,6 +287,5 @@
 
     default:
-        psTrace("utils.logMsg", 2, "Invalid logMsg level: %d (%s)\n",
-                level, fmt);
+        psTrace("utils.logMsg", 2, "Invalid logMsg level: %d (%s)\n", level, fmt);
         level = (level < 0) ? 0 : 9;
         break;
@@ -307,5 +296,5 @@
         maxLength -= snprintf(head_ptr, maxLength, "%4d:%02d:%02d %02d:%02d:%02dZ",
                               utc->tm_year + 1900, utc->tm_mon + 1, utc->tm_mday,
-                              utc->tm_hour, utc->tm_min, utc->tm_sec)-1;
+                              utc->tm_hour, utc->tm_min, utc->tm_sec) - 1;
         head_ptr += strlen(head_ptr);
     }
@@ -336,8 +325,7 @@
     if (head_ptr > head) {
         *head_ptr++ = '|';
-    } else
-        if (!logMsg) { // no output desired
-            return;
-        }
+    } else if (!logMsg) {                  // no output desired
+        return;
+    }
     *head_ptr = '\0';
 
@@ -352,5 +340,4 @@
     }
 }
-
 
 /*****************************************************************************
@@ -369,8 +356,5 @@
  NULL
  *****************************************************************************/
-void psLogMsg(const char *name,
-              int level,
-              const char *fmt,
-              ...)
+void psLogMsg(const char *name, int level, const char *fmt, ...)
 {
     va_list ap;
Index: trunk/psLib/src/sysUtils/psLogMsg.h
===================================================================
--- trunk/psLib/src/sysUtils/psLogMsg.h	(revision 1406)
+++ trunk/psLib/src/sysUtils/psLogMsg.h	(revision 1407)
@@ -1,2 +1,3 @@
+
 /** @file  psLogMsg.h
  *  @brief Procedures for logging messages.
@@ -11,12 +12,12 @@
  *  @author George Gusciora, MHPCC
  *
- *  @version $Revision: 1.12 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2004-08-06 22:34:05 $
+ *  @version $Revision: 1.13 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2004-08-07 00:06:06 $
  *
  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
  */
 #if !defined(PS_LOG_MSG_H)
-#define PS_LOG_MSG_H
-#include <stdarg.h>
+#    define PS_LOG_MSG_H
+#    include <stdarg.h>
 
 /** @addtogroup LogTrace
@@ -29,7 +30,6 @@
 /// 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.
+int psLogSetDestination(const char *dest        // /< Specifies where to send messages.
                        );
-
 
 /// This procedure sets the message level for future log messages.  Subsequent
@@ -38,7 +38,6 @@
 /// Ie. higher values set by this procedure will cause more log messages to
 /// be displayed.
-int psLogSetLevel(int level          ///< Specifies the system log level
+int psLogSetLevel(int level     // /< Specifies the system log level
                  );
-
 
 /// This procedure sets the log format for future log messages.  The argument
@@ -47,7 +46,6 @@
 /// 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
+void psLogSetFormat(const char *fmt     // /< Specifies the system log format
                    );
-
 
 /// This procedure logs a message to the destination set by a prior
@@ -55,16 +53,15 @@
 /// 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
+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
+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
               );
 
@@ -74,5 +71,6 @@
     PS_LOG_ERROR,
     PS_LOG_WARN,
-    PS_LOG_INFO };
+    PS_LOG_INFO
+};
 
 ///< Destinations for log messages
@@ -80,5 +78,6 @@
     PS_LOG_NONE,
     PS_LOG_TO_STDERR,
-    PS_LOG_TO_STDOUT };
+    PS_LOG_TO_STDOUT
+};
 
 /// @}
Index: trunk/psLib/src/sysUtils/psMemory.c
===================================================================
--- trunk/psLib/src/sysUtils/psMemory.c	(revision 1406)
+++ trunk/psLib/src/sysUtils/psMemory.c	(revision 1407)
@@ -1,2 +1,3 @@
+
 /** @file  psMemory.c
 *
@@ -8,11 +9,11 @@
 *  @author Robert Lupton, Princeton University
 *
-*  @version $Revision: 1.32 $ $Name: not supported by cvs2svn $
-*  @date $Date: 2004-08-06 22:34:05 $
+*  @version $Revision: 1.33 $ $Name: not supported by cvs2svn $
+*  @date $Date: 2004-08-07 00:06:06 $
 *
 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
 */
 
-#define PS_ALLOW_MALLOC                 // we're allowed to call malloc()
+#define PS_ALLOW_MALLOC                    // we're allowed to call malloc()
 
 #include <stdlib.h>
@@ -26,9 +27,9 @@
 #include "psLogMsg.h"
 
-#define P_PS_MEMMAGIC (void *)0xdeadbeef // Magic number in psMemBlock header
-
-#define P_PS_LARGE_BLOCK_SIZE 65536    // size where under, we try to recycle
-
-static int checkMemBlock( const psMemBlock *m, const char* funcName );
+#define P_PS_MEMMAGIC (void *)0xdeadbeef   // Magic number in psMemBlock header
+
+#define P_PS_LARGE_BLOCK_SIZE 65536        // size where under, we try to recycle
+
+static int checkMemBlock(const psMemBlock * m, const char *funcName);
 static psMemBlock *lastMemBlockAllocated = NULL;
 static pthread_mutex_t memBlockListMutex = PTHREAD_MUTEX_INITIALIZER;
@@ -38,17 +39,17 @@
 
 static int recycleBins = 13;
-static int recycleBinSize[ 14 ] =
-    {
-        8, 16, 32, 64, 128, 256, 512, 1024, 2048, 4096, 8192, 16384, 32768, P_PS_LARGE_BLOCK_SIZE
-    };
+static int recycleBinSize[14] = {
+                                    8, 16, 32, 64, 128, 256, 512, 1024, 2048, 4096, 8192, 16384, 32768, P_PS_LARGE_BLOCK_SIZE
+                                };
+
 // N.B. recycleBinSize should be terminated by P_PS_LARGE_BLOCK_SIZE (simplifies search loops)
-static psMemBlock* recycleMemBlockList[ 13 ] =
-    {
-        NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL
-    };
+static psMemBlock *recycleMemBlockList[13] = {
+            NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL
+        };
 
 #ifdef PS_MEM_DEBUG
-static psMemBlock* deadBlockList;    // a place to put dead memBlocks in debug mode.
+static psMemBlock *deadBlockList;       // a place to put dead memBlocks in debug mode.
 #endif
+
 /**
  * Unique ID for allocated blocks
@@ -59,20 +60,22 @@
  *  Default memExhausted callback.
  */
-static void *memExhaustedCallbackDefault( size_t size )
-{
-    void * ptr = NULL;
-
-    pthread_mutex_lock( &recycleMemBlockListMutex );
+static void *memExhaustedCallbackDefault(size_t size)
+{
+    void *ptr = NULL;
+
+    pthread_mutex_lock(&recycleMemBlockListMutex);
     int level = recycleBins - 1;
-    while ( level >= 0 && ptr == NULL ) {
-        while ( recycleMemBlockList[ level ] != NULL && ptr == NULL ) {
-            psMemBlock * old = recycleMemBlockList[ level ];
-            recycleMemBlockList[ level ] = recycleMemBlockList[ level ] ->nextBlock;
-            free( old );
-            ptr = malloc( size );
+
+    while (level >= 0 && ptr == NULL) {
+        while (recycleMemBlockList[level] != NULL && ptr == NULL) {
+            psMemBlock *old = recycleMemBlockList[level];
+
+            recycleMemBlockList[level] = recycleMemBlockList[level]->nextBlock;
+            free(old);
+            ptr = malloc(size);
         }
         level--;
     }
-    pthread_mutex_unlock( &recycleMemBlockListMutex );
+    pthread_mutex_unlock(&recycleMemBlockListMutex);
 
     return ptr;
@@ -81,9 +84,9 @@
 static psMemExhaustedCallback memExhaustedCallback = memExhaustedCallbackDefault;
 
-psMemExhaustedCallback psMemExhaustedCallbackSet( psMemExhaustedCallback func )
+psMemExhaustedCallback psMemExhaustedCallbackSet(psMemExhaustedCallback func)
 {
     psMemExhaustedCallback old = memExhaustedCallback;
 
-    if ( func != NULL ) {
+    if (func != NULL) {
         memExhaustedCallback = func;
     } else {
@@ -94,24 +97,23 @@
 }
 
-static void memProblemCallbackDefault( const psMemBlock *ptr,
-                                       const char *file, int lineno )
-{
-    if ( ptr->refCounter < 1 ) {
-        psError( __func__,
-                 "Block %ld allocated at %s:%d freed more than once at %s:%d\n",
-                 ptr->id, ptr->file, ptr->lineno, file, lineno );
-    }
-
-    if ( lineno > 0 ) {
-        psAbort( __func__, "Detected a problem in the memory system at %s:%d", file, lineno );
+static void memProblemCallbackDefault(const psMemBlock * ptr, const char *file, int lineno)
+{
+    if (ptr->refCounter < 1) {
+        psError(__func__,
+                "Block %ld allocated at %s:%d freed more than once at %s:%d\n",
+                ptr->id, ptr->file, ptr->lineno, file, lineno);
+    }
+
+    if (lineno > 0) {
+        psAbort(__func__, "Detected a problem in the memory system at %s:%d", file, lineno);
     }
 }
 static psMemProblemCallback memProblemCallback = memProblemCallbackDefault;
 
-psMemProblemCallback psMemProblemCallbackSet( psMemProblemCallback func )
+psMemProblemCallback psMemProblemCallbackSet(psMemProblemCallback func)
 {
     psMemProblemCallback old = memProblemCallback;
 
-    if ( func != NULL ) {
+    if (func != NULL) {
         memProblemCallback = func;
     } else {
@@ -121,4 +123,5 @@
     return old;
 }
+
 /*
  * And now the I-want-to-be-informed callbacks
@@ -126,10 +129,11 @@
  * Call the callbacks when these IDs are allocated/freed
  */
-psMemoryId p_psMemAllocateID = 0;  // notify user this block is allocated
+psMemoryId p_psMemAllocateID = 0;       // notify user this block is allocated
 psMemoryId p_psMemFreeID = 0;   // notify user this block is freed
 
-psMemoryId psMemAllocateCallbackSetID( psMemoryId id )
+psMemoryId psMemAllocateCallbackSetID(psMemoryId id)
 {
     psMemoryId old = p_psMemAllocateID;
+
     p_psMemAllocateID = id;
 
@@ -137,7 +141,8 @@
 }
 
-psMemoryId psMemFreeCallbackSetID( psMemoryId id )
+psMemoryId psMemFreeCallbackSetID(psMemoryId id)
 {
     psMemoryId old = p_psMemFreeID;
+
     p_psMemFreeID = id;
 
@@ -151,14 +156,14 @@
  * isn't resignalled)
  */
-static psMemoryId memAllocateCallbackDefault( const psMemBlock *ptr )
-{
-    static psMemoryId incr = 0;  // "p_psMemAllocateID += incr"
+static psMemoryId memAllocateCallbackDefault(const psMemBlock * ptr)
+{
+    static psMemoryId incr = 0; // "p_psMemAllocateID += incr"
 
     return incr;
 }
 
-static psMemoryId memFreeCallbackDefault( const psMemBlock *ptr )
-{
-    static psMemoryId incr = 0;  // "p_psMemFreeID += incr"
+static psMemoryId memFreeCallbackDefault(const psMemBlock * ptr)
+{
+    static psMemoryId incr = 0; // "p_psMemFreeID += incr"
 
     return incr;
@@ -171,9 +176,9 @@
 static psMemFreeCallback memFreeCallback = memFreeCallbackDefault;
 
-psMemAllocateCallback psMemAllocateCallbackSet( psMemAllocateCallback func )
+psMemAllocateCallback psMemAllocateCallbackSet(psMemAllocateCallback func)
 {
     psMemFreeCallback old = memAllocateCallback;
 
-    if ( func != NULL ) {
+    if (func != NULL) {
         memAllocateCallback = func;
     } else {
@@ -184,9 +189,9 @@
 }
 
-psMemFreeCallback psMemFreeCallbackSet( psMemFreeCallback func )
+psMemFreeCallback psMemFreeCallbackSet(psMemFreeCallback func)
 {
     psMemFreeCallback old = memFreeCallback;
 
-    if ( func != NULL ) {
+    if (func != NULL) {
         memFreeCallback = func;
     } else {
@@ -200,10 +205,11 @@
  * Return memory ID counter for next block to be allocated
  */
-psMemoryId psMemGetId( void )
+psMemoryId psMemGetId(void)
 {
     psMemoryId id;
-    pthread_mutex_lock( &memIdMutex );
+
+    pthread_mutex_lock(&memIdMutex);
     id = memid + 1;
-    pthread_mutex_unlock( &memIdMutex );
+    pthread_mutex_unlock(&memIdMutex);
 
     return id;
@@ -216,29 +222,26 @@
  */
 
-static int checkMemBlock( const psMemBlock *m, const char* funcName )
+static int checkMemBlock(const psMemBlock * m, const char *funcName)
 {
     // n.b. since this is called by psMemCheckCorruption while the memblock list is mutex locked,
     // we shouldn't call such things as p_psAlloc/p_psFree here.
 
-    if ( m == NULL ) {
-        psError( funcName, "Memory Corruption: NULL memory block found." );
+    if (m == NULL) {
+        psError(funcName, "Memory Corruption: NULL memory block found.");
         return 1;
     }
 
-    if ( m->refCounter == 0 ) {
+    if (m->refCounter == 0) {
         // using an unreferenced block of memory, are you?
-        psError( __func__, "Memory Corruption: memory block %ld was freed but still used.",
-                 m->id );
+        psError(__func__, "Memory Corruption: memory block %ld was freed but still used.", m->id);
         return 1;
     }
 
-    if ( m->startblock != P_PS_MEMMAGIC || m->endblock != P_PS_MEMMAGIC ) {
-        psError( funcName, "Memory Corruption: memory block %ld is corrupted (buffer underflow)",
-                 m->id );
+    if (m->startblock != P_PS_MEMMAGIC || m->endblock != P_PS_MEMMAGIC) {
+        psError(funcName, "Memory Corruption: memory block %ld is corrupted (buffer underflow)", m->id);
         return 1;
     }
-    if ( *( void** ) ( ( int8_t* ) ( m + 1 ) + m->userMemorySize ) != P_PS_MEMMAGIC ) {
-        psError( funcName, "Memory Corruption: memory block %ld is corrupted (buffer overflow)",
-                 m->id );
+    if (*(void **)((int8_t *) (m + 1) + m->userMemorySize) != P_PS_MEMMAGIC) {
+        psError(funcName, "Memory Corruption: memory block %ld is corrupted (buffer overflow)", m->id);
         return 1;
     }
@@ -247,21 +250,21 @@
 }
 
-int psMemCheckCorruption( bool abort_on_error )
-{
-    int nbad = 0;                       // number of bad blocks
+int psMemCheckCorruption(bool abort_on_error)
+{
+    int nbad = 0;               // number of bad blocks
 
     // get exclusive access to the memBlock list to avoid it changing on us while we use it.
-    pthread_mutex_lock( &memBlockListMutex );
-
-    for ( psMemBlock * iter = lastMemBlockAllocated; iter != NULL; iter = iter->nextBlock ) {
-        if ( checkMemBlock( iter, __func__ ) ) {
+    pthread_mutex_lock(&memBlockListMutex);
+
+    for (psMemBlock * iter = lastMemBlockAllocated; iter != NULL; iter = iter->nextBlock) {
+        if (checkMemBlock(iter, __func__)) {
             nbad++;
 
-            memProblemCallback( iter, __func__, __LINE__ );
-
-            if ( abort_on_error ) {
+            memProblemCallback(iter, __func__, __LINE__);
+
+            if (abort_on_error) {
                 // release the lock on the memblock list
-                pthread_mutex_unlock( &memBlockListMutex );
-                psAbort( __func__, "Detected memory corruption" );
+                pthread_mutex_unlock(&memBlockListMutex);
+                psAbort(__func__, "Detected memory corruption");
                 return nbad;
             }
@@ -270,48 +273,48 @@
 
     // release the lock on the memblock list
-    pthread_mutex_unlock( &memBlockListMutex );
+    pthread_mutex_unlock(&memBlockListMutex);
     return nbad;
 }
 
-void *p_psAlloc( size_t size, const char *file, int lineno )
-{
-
-    psMemBlock * ptr = NULL;
+void *p_psAlloc(size_t size, const char *file, int lineno)
+{
+
+    psMemBlock *ptr = NULL;
 
     // memory is of the size I want to bother recycling?
-    if ( size < P_PS_LARGE_BLOCK_SIZE ) {
+    if (size < P_PS_LARGE_BLOCK_SIZE) {
         // find the bin we need.
         int level = 0;
-        while ( size > recycleBinSize[ level ] ) {
+
+        while (size > recycleBinSize[level]) {
             level++;
         }
         // Are we in one of the bins
-        if ( level < recycleBins ) {
-
-            size = recycleBinSize[ level ];  // round-up size to next sized bin.
-
-            pthread_mutex_lock( &recycleMemBlockListMutex );
-
-            if ( recycleMemBlockList[ level ] != NULL ) {
-                ptr = recycleMemBlockList[ level ];
-                recycleMemBlockList[ level ] = ptr->nextBlock;
-                if ( recycleMemBlockList[ level ] != NULL ) {
-                    recycleMemBlockList[ level ] ->previousBlock = NULL;
+        if (level < recycleBins) {
+
+            size = recycleBinSize[level];  // round-up size to next sized bin.
+
+            pthread_mutex_lock(&recycleMemBlockListMutex);
+
+            if (recycleMemBlockList[level] != NULL) {
+                ptr = recycleMemBlockList[level];
+                recycleMemBlockList[level] = ptr->nextBlock;
+                if (recycleMemBlockList[level] != NULL) {
+                    recycleMemBlockList[level]->previousBlock = NULL;
                 }
                 size = ptr->userMemorySize;
             }
 
-            pthread_mutex_unlock( &recycleMemBlockListMutex );
-        }
-    }
-
-    if ( ptr == NULL ) {
-        ptr = malloc( sizeof( psMemBlock ) + size + sizeof( void* ) );
-
-        if ( ptr == NULL ) {
-            ptr = memExhaustedCallback( size );
-            if ( ptr == NULL ) {
-                psAbort( __func__, "Failed to allocate %u bytes at %s:%d",
-                         size, file, lineno );
+            pthread_mutex_unlock(&recycleMemBlockListMutex);
+        }
+    }
+
+    if (ptr == NULL) {
+        ptr = malloc(sizeof(psMemBlock) + size + sizeof(void *));
+
+        if (ptr == NULL) {
+            ptr = memExhaustedCallback(size);
+            if (ptr == NULL) {
+                psAbort(__func__, "Failed to allocate %u bytes at %s:%d", size, file, lineno);
             }
         }
@@ -320,95 +323,91 @@
         ptr->endblock = P_PS_MEMMAGIC;
         ptr->userMemorySize = size;
-        pthread_mutex_init( &ptr->refCounterMutex, NULL );
-    }
-
+        pthread_mutex_init(&ptr->refCounterMutex, NULL);
+    }
     // increment the memory id safely.
-    pthread_mutex_lock( &memBlockListMutex );
-    *( psMemoryId* ) & ptr->id = ++memid;
-    pthread_mutex_unlock( &memBlockListMutex );
+    pthread_mutex_lock(&memBlockListMutex);
+    *(psMemoryId *) & ptr->id = ++memid;
+    pthread_mutex_unlock(&memBlockListMutex);
 
     ptr->file = file;
     ptr->freeFcn = NULL;
-    *( unsigned int* ) & ptr->lineno = lineno;
-    *( void** ) ( ( int8_t* ) ( ptr + 1 ) + size ) = P_PS_MEMMAGIC;
+    *(unsigned int *)&ptr->lineno = lineno;
+    *(void **)((int8_t *) (ptr + 1) + size) = P_PS_MEMMAGIC;
     ptr->previousBlock = NULL;
 
-    ptr->refCounter = 1;                // one user so far
+    ptr->refCounter = 1;                   // one user so far
 
     // need exclusive access of the memory block list now...
-    pthread_mutex_lock( &memBlockListMutex );
+    pthread_mutex_lock(&memBlockListMutex);
 
     // insert the new block to the front of the memBlock linked-list
     ptr->nextBlock = lastMemBlockAllocated;
-    if ( ptr->nextBlock != NULL ) {
+    if (ptr->nextBlock != NULL) {
         ptr->nextBlock->previousBlock = ptr;
     }
     lastMemBlockAllocated = ptr;
 
-    pthread_mutex_unlock( &memBlockListMutex );
-
-    //  Did the user ask to be informed about this allocation?
-    if ( ptr->id == p_psMemAllocateID ) {
-        p_psMemAllocateID += memAllocateCallback( ptr );
-    }
-
+    pthread_mutex_unlock(&memBlockListMutex);
+
+    // Did the user ask to be informed about this allocation?
+    if (ptr->id == p_psMemAllocateID) {
+        p_psMemAllocateID += memAllocateCallback(ptr);
+    }
     // And return the user the memory that they allocated
-    return ptr + 1;   // user memory
-}
-
-void *p_psRealloc( void *vptr, size_t size, const char *file, int lineno )
-{
-    if ( vptr == NULL ) {
-        return p_psAlloc( size, file, lineno );
+    return ptr + 1;                        // user memory
+}
+
+void *p_psRealloc(void *vptr, size_t size, const char *file, int lineno)
+{
+    if (vptr == NULL) {
+        return p_psAlloc(size, file, lineno);
     } else {
-        psMemBlock *ptr = ( ( psMemBlock * ) vptr ) - 1;
+        psMemBlock *ptr = ((psMemBlock *) vptr) - 1;
         bool isBlockLast = false;
 
-        if ( checkMemBlock( ptr, __func__ ) != 0 ) {
-            memProblemCallback( ptr, file, lineno );
-            psAbort( file, "Realloc detected a memory corruption (id %ld @ %s:%d).",
-                     ptr->id, ptr->file, ptr->lineno );
-        }
-
-        pthread_mutex_lock( &memBlockListMutex );
-
-        isBlockLast = ( ptr == lastMemBlockAllocated );
-
-        ptr = ( psMemBlock* ) realloc( ptr, sizeof( psMemBlock ) + size + sizeof( void* ) );
-
-        if ( ptr == NULL ) {
-            psAbort( __func__, "Failed to reallocate %ld bytes at %s:%d",
-                     size, file, lineno );
+        if (checkMemBlock(ptr, __func__) != 0) {
+            memProblemCallback(ptr, file, lineno);
+            psAbort(file, "Realloc detected a memory corruption (id %ld @ %s:%d).",
+                    ptr->id, ptr->file, ptr->lineno);
+        }
+
+        pthread_mutex_lock(&memBlockListMutex);
+
+        isBlockLast = (ptr == lastMemBlockAllocated);
+
+        ptr = (psMemBlock *) realloc(ptr, sizeof(psMemBlock) + size + sizeof(void *));
+
+        if (ptr == NULL) {
+            psAbort(__func__, "Failed to reallocate %ld bytes at %s:%d", size, file, lineno);
         }
 
         ptr->userMemorySize = size;
-        *( void** ) ( ( int8_t* ) ( ptr + 1 ) + size ) = P_PS_MEMMAGIC;
-
-        if ( isBlockLast ) {
+        *(void **)((int8_t *) (ptr + 1) + size) = P_PS_MEMMAGIC;
+
+        if (isBlockLast) {
             lastMemBlockAllocated = ptr;
         }
-
         // the block location may have changed, so fix the linked list addresses.
-        if ( ptr->nextBlock != NULL ) {
+        if (ptr->nextBlock != NULL) {
             ptr->nextBlock->previousBlock = ptr;
         }
-        if ( ptr->previousBlock != NULL ) {
+        if (ptr->previousBlock != NULL) {
             ptr->previousBlock->nextBlock = ptr;
         }
 
-        pthread_mutex_unlock( &memBlockListMutex );
-
-        //  Did the user ask to be informed about this allocation?
-        if ( ptr->id == p_psMemAllocateID ) {
-            p_psMemAllocateID += memAllocateCallback( ptr );
-        }
-
-        return ptr + 1;   // usr memory
-    }
-}
-
-void p_psFree( void *vptr, const char *file, int lineno )
-{
-    ( void ) p_psMemDecrRefCounter( vptr, file, lineno );   // this handles the free, if required.
+        pthread_mutex_unlock(&memBlockListMutex);
+
+        // Did the user ask to be informed about this allocation?
+        if (ptr->id == p_psMemAllocateID) {
+            p_psMemAllocateID += memAllocateCallback(ptr);
+        }
+
+        return ptr + 1;                    // usr memory
+    }
+}
+
+void p_psFree(void *vptr, const char *file, int lineno)
+{
+    (void)p_psMemDecrRefCounter(vptr, file, lineno);    // this handles the free, if required.
 }
 
@@ -416,39 +415,39 @@
  * Check for memory leaks.
  */
-int psMemCheckLeaks( psMemoryId id0, psMemBlock ***arr, FILE *fd )
+int psMemCheckLeaks(psMemoryId id0, psMemBlock *** arr, FILE * fd)
 {
     int nleak = 0;
     int j = 0;
-    psMemBlock* topBlock = lastMemBlockAllocated;
-
-    pthread_mutex_lock( &memBlockListMutex );
-
-    for ( psMemBlock * iter = topBlock; iter != NULL; iter = iter->nextBlock ) {
-        if ( ( psMemGetRefCounter( iter + 1 ) > 0 ) && ( iter->id >= id0 ) ) {
+    psMemBlock *topBlock = lastMemBlockAllocated;
+
+    pthread_mutex_lock(&memBlockListMutex);
+
+    for (psMemBlock * iter = topBlock; iter != NULL; iter = iter->nextBlock) {
+        if ((psMemGetRefCounter(iter + 1) > 0) && (iter->id >= id0)) {
             nleak++;
 
-            if ( fd != NULL ) {
-                if ( nleak == 1 ) {
-                    fprintf( fd, "   %20s:line ID\n", "file" );
+            if (fd != NULL) {
+                if (nleak == 1) {
+                    fprintf(fd, "   %20s:line ID\n", "file");
                 }
 
-                fprintf( fd, "   %20s:%-4d %ld\n", iter->file, iter->lineno, iter->id );
-            }
-        }
-    }
-
-    pthread_mutex_unlock( &memBlockListMutex );
-
-    if ( nleak == 0 || arr == NULL ) {
+                fprintf(fd, "   %20s:%-4d %ld\n", iter->file, iter->lineno, iter->id);
+            }
+        }
+    }
+
+    pthread_mutex_unlock(&memBlockListMutex);
+
+    if (nleak == 0 || arr == NULL) {
         return nleak;
     }
 
-    *arr = p_psAlloc( nleak * sizeof( psMemBlock ), __FILE__, __LINE__ );
-    pthread_mutex_lock( &memBlockListMutex );
-
-    for ( psMemBlock * iter = topBlock; iter != NULL; iter = iter->nextBlock ) {
-        if ( ( psMemGetRefCounter( iter + 1 ) > 0 ) && ( iter->id >= id0 ) ) {
-            ( *arr ) [ j++ ] = iter;
-            if ( j == nleak ) { // found them all
+    *arr = p_psAlloc(nleak * sizeof(psMemBlock), __FILE__, __LINE__);
+    pthread_mutex_lock(&memBlockListMutex);
+
+    for (psMemBlock * iter = topBlock; iter != NULL; iter = iter->nextBlock) {
+        if ((psMemGetRefCounter(iter + 1) > 0) && (iter->id >= id0)) {
+            (*arr)[j++] = iter;
+            if (j == nleak) {              // found them all
                 break;
             }
@@ -456,5 +455,5 @@
     }
 
-    pthread_mutex_unlock( &memBlockListMutex );
+    pthread_mutex_unlock(&memBlockListMutex);
 
     return nleak;
@@ -465,43 +464,44 @@
  */
 // return refCounter
-psReferenceCount psMemGetRefCounter( void *vptr )
-{
-    psMemBlock * ptr;
+psReferenceCount psMemGetRefCounter(void *vptr)
+{
+    psMemBlock *ptr;
     unsigned int refCount;
 
-    if ( vptr == NULL ) {
+    if (vptr == NULL) {
         return 0;
     }
 
-    ptr = ( ( psMemBlock * ) vptr ) - 1;
-
-    if ( checkMemBlock( ptr, __func__ ) != 0 ) {
-        memProblemCallback( ptr, __func__, __LINE__ );
-    }
-
-    pthread_mutex_lock( &ptr->refCounterMutex );
+    ptr = ((psMemBlock *) vptr) - 1;
+
+    if (checkMemBlock(ptr, __func__) != 0) {
+        memProblemCallback(ptr, __func__, __LINE__);
+    }
+
+    pthread_mutex_lock(&ptr->refCounterMutex);
     refCount = ptr->refCounter;
-    pthread_mutex_unlock( &ptr->refCounterMutex );
+    pthread_mutex_unlock(&ptr->refCounterMutex);
 
     return refCount;
 }
+
 // increment and return refCounter
-void* p_psMemIncrRefCounter( void *vptr, const char *file, int lineno )
-{
-    psMemBlock * ptr;
-
-    if ( vptr == NULL ) {
+void *p_psMemIncrRefCounter(void *vptr, const char *file, int lineno)
+{
+    psMemBlock *ptr;
+
+    if (vptr == NULL) {
         return vptr;
     }
 
-    ptr = ( ( psMemBlock * ) vptr ) - 1;
-
-    if ( checkMemBlock( ptr, __func__ ) ) {
-        memProblemCallback( ptr, file, lineno );
-    }
-
-    pthread_mutex_lock( &ptr->refCounterMutex );
+    ptr = ((psMemBlock *) vptr) - 1;
+
+    if (checkMemBlock(ptr, __func__)) {
+        memProblemCallback(ptr, file, lineno);
+    }
+
+    pthread_mutex_lock(&ptr->refCounterMutex);
     ptr->refCounter++;
-    pthread_mutex_unlock( &ptr->refCounterMutex );
+    pthread_mutex_unlock(&ptr->refCounterMutex);
 
     return vptr;
@@ -509,57 +509,57 @@
 
 // decrement and return refCounter
-void* p_psMemDecrRefCounter( void *vptr, const char *file, int lineno )
-{
-    if ( vptr == NULL ) {
+void *p_psMemDecrRefCounter(void *vptr, const char *file, int lineno)
+{
+    if (vptr == NULL) {
         return NULL;
     }
 
-    psMemBlock *ptr = ( ( psMemBlock * ) vptr ) - 1;
-
-    if ( checkMemBlock( ptr, __func__ ) != 0 ) {
-        memProblemCallback( ptr, file, lineno );
+    psMemBlock *ptr = ((psMemBlock *) vptr) - 1;
+
+    if (checkMemBlock(ptr, __func__) != 0) {
+        memProblemCallback(ptr, file, lineno);
         return NULL;
     }
 
-    pthread_mutex_lock( &ptr->refCounterMutex );
-
-    if ( ptr->refCounter > 1 ) {
-        /// XXX - Probably should have another mutex here.
-        ptr->refCounter--;          // multiple references, just decrement the count.
-        pthread_mutex_unlock( &ptr->refCounterMutex );
+    pthread_mutex_lock(&ptr->refCounterMutex);
+
+    if (ptr->refCounter > 1) {
+        // / XXX - Probably should have another mutex here.
+        ptr->refCounter--;                 // multiple references, just decrement the count.
+        pthread_mutex_unlock(&ptr->refCounterMutex);
 
     } else {
-        pthread_mutex_unlock( &ptr->refCounterMutex );
+        pthread_mutex_unlock(&ptr->refCounterMutex);
 
         // Did the user ask to be informed about this deallocation?
-        if ( ptr->id == p_psMemFreeID ) {
-            p_psMemFreeID += memFreeCallback( ptr );
-        }
-
-        if ( ptr->freeFcn != NULL ) {
-            ptr->freeFcn( vptr );
-        }
-
-        pthread_mutex_lock( &memBlockListMutex );
+        if (ptr->id == p_psMemFreeID) {
+            p_psMemFreeID += memFreeCallback(ptr);
+        }
+
+        if (ptr->freeFcn != NULL) {
+            ptr->freeFcn(vptr);
+        }
+
+        pthread_mutex_lock(&memBlockListMutex);
 
         // cut the memBlock out of the memBlock list
-        if ( ptr->nextBlock != NULL ) {
+        if (ptr->nextBlock != NULL) {
             ptr->nextBlock->previousBlock = ptr->previousBlock;
         }
-        if ( ptr->previousBlock != NULL ) {
+        if (ptr->previousBlock != NULL) {
             ptr->previousBlock->nextBlock = ptr->nextBlock;
         }
-        if ( lastMemBlockAllocated == ptr ) {
+        if (lastMemBlockAllocated == ptr) {
             lastMemBlockAllocated = ptr->nextBlock;
         }
 
-        pthread_mutex_unlock( &memBlockListMutex );
-
+        pthread_mutex_unlock(&memBlockListMutex);
 
         // do we need to recycle?
-        if ( ptr->userMemorySize < P_PS_LARGE_BLOCK_SIZE ) {
+        if (ptr->userMemorySize < P_PS_LARGE_BLOCK_SIZE) {
 
             int level = 1;
-            while ( ptr->userMemorySize >= recycleBinSize[ level ] ) {
+
+            while (ptr->userMemorySize >= recycleBinSize[level]) {
                 level++;
             }
@@ -569,19 +569,19 @@
             ptr->previousBlock = NULL;
 
-            pthread_mutex_lock( &recycleMemBlockListMutex );
-            ptr->nextBlock = recycleMemBlockList[ level ];
-            if ( recycleMemBlockList[ level ] != NULL ) {
-                recycleMemBlockList[ level ] ->previousBlock = ptr;
-            }
-            recycleMemBlockList[ level ] = ptr;
-            pthread_mutex_unlock( &recycleMemBlockListMutex );
+            pthread_mutex_lock(&recycleMemBlockListMutex);
+            ptr->nextBlock = recycleMemBlockList[level];
+            if (recycleMemBlockList[level] != NULL) {
+                recycleMemBlockList[level]->previousBlock = ptr;
+            }
+            recycleMemBlockList[level] = ptr;
+            pthread_mutex_unlock(&recycleMemBlockListMutex);
 
         } else {
             // memory is larger than I want to recycle.
             #ifdef PS_MEM_DEBUG
-            ( void ) p_psRealloc( vptr, 0, file, lineno );
+            (void)p_psRealloc(vptr, 0, file, lineno);
             ptr->previousBlock = NULL;
             ptr->nextBlock = deadBlockList;
-            if ( deadBlockList != NULL ) {
+            if (deadBlockList != NULL) {
                 deadBlockList->previous = ptr;
             }
@@ -589,11 +589,11 @@
             #else
 
-            pthread_mutex_destroy( &ptr->refCounterMutex );
-            free( ptr );
+            pthread_mutex_destroy(&ptr->refCounterMutex);
+            free(ptr);
             #endif
 
         }
 
-        vptr = NULL;    // since we freed it, make sure we return NULL.
+        vptr = NULL;                       // since we freed it, make sure we return NULL.
     }
 
@@ -601,14 +601,14 @@
 }
 
-void p_psMemSetDeallocator( void* vptr, psFreeFcn freeFcn )
-{
-    if ( vptr == NULL ) {
-        return ;
-    }
-
-    psMemBlock *ptr = ( ( psMemBlock * ) vptr ) - 1;
-
-    if ( checkMemBlock( ptr, __func__ ) != 0 ) {
-        memProblemCallback( ptr, __func__, __LINE__ );
+void p_psMemSetDeallocator(void *vptr, psFreeFcn freeFcn)
+{
+    if (vptr == NULL) {
+        return;
+    }
+
+    psMemBlock *ptr = ((psMemBlock *) vptr) - 1;
+
+    if (checkMemBlock(ptr, __func__) != 0) {
+        memProblemCallback(ptr, __func__, __LINE__);
     }
 
@@ -616,14 +616,14 @@
 
 }
-psFreeFcn p_psMemGetDeallocator( void* vptr )
-{
-    if ( vptr == NULL ) {
+psFreeFcn p_psMemGetDeallocator(void *vptr)
+{
+    if (vptr == NULL) {
         return NULL;
     }
 
-    psMemBlock *ptr = ( ( psMemBlock * ) vptr ) - 1;
-
-    if ( checkMemBlock( ptr, __func__ ) != 0 ) {
-        memProblemCallback( ptr, __func__, __LINE__ );
+    psMemBlock *ptr = ((psMemBlock *) vptr) - 1;
+
+    if (checkMemBlock(ptr, __func__) != 0) {
+        memProblemCallback(ptr, __func__, __LINE__);
     }
 
Index: trunk/psLib/src/sysUtils/psMemory.h
===================================================================
--- trunk/psLib/src/sysUtils/psMemory.h	(revision 1406)
+++ trunk/psLib/src/sysUtils/psMemory.h	(revision 1407)
@@ -1,4 +1,5 @@
 #if !defined(PS_MEMORY_H)
-#define PS_MEMORY_H
+#    define PS_MEMORY_H
+
 /** @file  psMemory.h
  *
@@ -14,13 +15,13 @@
  *  @ingroup MemoryManagement
  *
- *  @version $Revision: 1.23 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2004-08-06 22:34:05 $
+ *  @version $Revision: 1.24 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2004-08-07 00:06:06 $
  *
  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
  */
 
-#include <stdio.h>                      // needed for FILE
-#include <stdbool.h>
-#include <pthread.h>                    // we need a mutex to make this stuff thread safe.
+#    include <stdio.h>                     // needed for FILE
+#    include <stdbool.h>
+#    include <pthread.h>                   // we need a mutex to make this stuff thread safe.
 
 /** @addtogroup MemoryManagement
@@ -53,5 +54,5 @@
 
 /// typedef for deallocator.
-typedef void (*psFreeFcn)(void* ptr);
+typedef void (*psFreeFcn) (void *ptr);
 
 /** Book-keeping data for storage allocator.
@@ -62,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;
@@ -81,7 +82,6 @@
  *  @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,7 +90,6 @@
  *  @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
@@ -101,9 +100,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
@@ -115,7 +114,6 @@
  *  @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.
@@ -124,22 +122,19 @@
  *  @see psFree 
  */
-#ifdef DOXYGEN
-void* psAlloc(
-    size_t size                     ///< Size required
-);
-#else
-void* p_psAlloc(
-    size_t size,                    ///< Size required
-    const char *file,               ///< File of call
-    int lineno                      ///< Line number of call
-);
-
-void p_psMemSetDeallocator(void* ptr, psFreeFcn freeFcn);
-psFreeFcn p_psMemGetDeallocator(void* ptr);
+#    ifdef DOXYGEN
+void *psAlloc(size_t size       // /< Size required
+             );
+#    else
+    void *p_psAlloc(size_t size,    // /< Size required
+                    const char *file,       // /< File of call
+                    int lineno      // /< Line number of call
+                   );
+
+void p_psMemSetDeallocator(void *ptr, psFreeFcn freeFcn);
+psFreeFcn p_psMemGetDeallocator(void *ptr);
 
 /// Memory allocation. psAlloc sends file and line number to p_psAlloc.
-#define psAlloc(size) p_psAlloc(size, __FILE__, __LINE__)
-#endif
-
+#        define psAlloc(size) p_psAlloc(size, __FILE__, __LINE__)
+#    endif
 
 /** Memory re-allocation.  This operates much like realloc(), but is guaranteed to return a non-NULL value.
@@ -148,38 +143,37 @@
  *  @see psAlloc, psFree
  */
-#ifdef DOXYGEN
-void* psRealloc(void *ptr               ///< Pointer to re-allocate
-                size_t size,            ///< Size required
+#    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
+#    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.
+#        define psRealloc(ptr, size) p_psRealloc(ptr, size, __FILE__, __LINE__)
+
+#    endif
+
+/** Free memory.  This operates much like free().
+ *
+ *  @see psAlloc, psRealloc
+ */
+#    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
                  );
 
-/// Memory re-allocation.  psRealloc sends file and line number to p_psRealloc.
-#define psRealloc(ptr, size) p_psRealloc(ptr, size, __FILE__, __LINE__)
-
-#endif
-
-
-/** Free memory.  This operates much like free().
- *
- *  @see psAlloc, psRealloc
- */
-#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
-             );
-
 /// Free memory.  psFree sends file and line number to p_psFree.
-#define psFree(size) p_psFree(size, __FILE__, __LINE__)
-
-#endif
+#        define psFree(size) p_psFree(size, __FILE__, __LINE__)
+
+#    endif
 
 /** Check for memory leaks.  This scans for allocated memory buffers not freed with an ID not less than id0.
@@ -197,9 +191,8 @@
  *  @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,
@@ -208,7 +201,6 @@
  *  @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
@@ -216,7 +208,6 @@
  *  @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
@@ -224,16 +215,15 @@
  *  @ingroup memRefCount
  */
-#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
-);
-#define psMemIncrRefCounter(vptr) p_psMemIncrRefCounter(vptr, __FILE__, __LINE__)
-#endif
+#    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
+                               );
+
+#        define psMemIncrRefCounter(vptr) p_psMemIncrRefCounter(vptr, __FILE__, __LINE__)
+#    endif
 
 /** Decrement reference counter and return the pointer
@@ -241,23 +231,21 @@
  *  @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
-);
-#define psMemDecrRefCounter(vptr) p_psMemDecrRefCounter(vptr, __FILE__, __LINE__)
-#endif
+#    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
-);
+psMemProblemCallback psMemProblemCallbackSet(psMemProblemCallback func  // /< Function to run
+                                            );
 
 /** Set callback for out-of-memory
@@ -265,7 +253,6 @@
  *  @ingroup memCallback
  */
-psMemExhaustedCallback psMemExhaustedCallbackSet(
-    psMemExhaustedCallback func     ///< Function to run
-);
+psMemExhaustedCallback psMemExhaustedCallbackSet(psMemExhaustedCallback func    // /< Function to run
+                                                );
 
 /** Set call back for when a particular memory block is allocated
@@ -273,7 +260,6 @@
  *  @ingroup memCallback
  */
-psMemAllocateCallback psMemAllocateCallbackSet(
-    psMemAllocateCallback func          ///< Function to run
-);
+psMemAllocateCallback psMemAllocateCallbackSet(psMemAllocateCallback func       // /< Function to run
+                                              );
 
 /** Set call back for when a particular memory block is freed
@@ -281,7 +267,6 @@
  *  @ingroup memCallback
  */
-psMemFreeCallback psMemFreeCallbackSet(
-    psMemFreeCallback func              ///< Function to run
-);
+psMemFreeCallback psMemFreeCallbackSet(psMemFreeCallback func   // /< Function to run
+                                      );
 
 /** get next memory ID
@@ -295,7 +280,6 @@
  *  @ingroup memCallback
  */
-psMemoryId psMemAllocateCallbackSetID(
-    psMemoryId id                       ///< ID to set
-);
+psMemoryId psMemAllocateCallbackSetID(psMemoryId id     // /< ID to set
+                                     );
 
 /** set p_psMemFreeID to id
@@ -303,27 +287,27 @@
  *  @ingroup memCallback
  */
-psMemoryId psMemFreeCallbackSetID(
-    psMemoryId id                       ///< ID to set
-);
+psMemoryId psMemFreeCallbackSetID(psMemoryId id // /< ID to set
+                                 );
 
 //@} End of Memory Management Functions
 
-#ifndef DOXYGEN
+#    ifndef DOXYGEN
 
 /*
  * Ensure that any program using malloc/realloc/free will fail to compile
  */
-#ifndef PS_ALLOW_MALLOC
-#ifdef __GNUC__
-#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 // doxygen skip
-
-#endif // end of header file
+#        ifndef PS_ALLOW_MALLOC
+#            ifdef __GNUC__
+#                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
+    // doxygen skip
+
+    #endif // end of header file
Index: trunk/psLib/src/sysUtils/psString.c
===================================================================
--- trunk/psLib/src/sysUtils/psString.c	(revision 1406)
+++ trunk/psLib/src/sysUtils/psString.c	(revision 1407)
@@ -1,2 +1,3 @@
+
 /** @file  psString.c
  *
@@ -8,6 +9,6 @@
  *  @author Eric Van Alst, MHPCC
  *   
- *  @version $Revision: 1.7 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2004-08-06 22:34:05 $
+ *  @version $Revision: 1.8 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2004-08-07 00:06:06 $
  *
  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -15,5 +16,7 @@
 
 /******************************************************************************/
+
 /*  INCLUDE FILES                                                             */
+
 /******************************************************************************/
 #include <stdlib.h>
@@ -24,5 +27,7 @@
 
 /******************************************************************************/
+
 /*  DEFINE STATEMENTS                                                         */
+
 /******************************************************************************/
 
@@ -30,5 +35,7 @@
 
 /******************************************************************************/
+
 /*  TYPE DEFINITIONS                                                          */
+
 /******************************************************************************/
 
@@ -36,5 +43,7 @@
 
 /*****************************************************************************/
+
 /*  GLOBAL VARIABLES                                                         */
+
 /*****************************************************************************/
 
@@ -42,5 +51,7 @@
 
 /*****************************************************************************/
+
 /*  FILE STATIC VARIABLES                                                    */
+
 /*****************************************************************************/
 
@@ -48,5 +59,7 @@
 
 /*****************************************************************************/
+
 /*  FUNCTION IMPLEMENTATION - LOCAL                                          */
+
 /*****************************************************************************/
 
@@ -54,10 +67,10 @@
 
 /*****************************************************************************/
+
 /* FUNCTION IMPLEMENTATION - PUBLIC                                          */
+
 /*****************************************************************************/
 
-char *psStringCopy(
-    const char*  str
-)
+char *psStringCopy(const char *str)
 {
     // Allocate memory using psAlloc function
@@ -67,16 +80,12 @@
 }
 
-char *psStringNCopy(
-    const char*  str,
-    int          nChar
-)
+char *psStringNCopy(const char *str, int nChar)
 {
     char *returnValue = NULL;
 
     // Check the number of characters to copy is non-negative
-    if ( nChar < 0 ) {
+    if (nChar < 0) {
         // Log error message and return NULL
-        psError(__FILE__,"psStringNCopy with negative count specified %d",
-                nChar);
+        psError(__FILE__, "psStringNCopy with negative count specified %d", nChar);
         return NULL;
     }
@@ -84,14 +93,11 @@
     // Copy input string to memory allocated up to nChar characters
     // Return the copy
-    returnValue = strncpy(psAlloc((size_t)nChar + 1), str, (size_t)nChar);
+    returnValue = strncpy(psAlloc((size_t) nChar + 1), str, (size_t) nChar);
 
     // Ensure the last byte is NULL character
-    if ( nChar > 0 ) {
-        returnValue[nChar-1] = '\0';
+    if (nChar > 0) {
+        returnValue[nChar - 1] = '\0';
     }
-
     // Return the string pointer
     return returnValue;
 }
-
-
Index: trunk/psLib/src/sysUtils/psString.h
===================================================================
--- trunk/psLib/src/sysUtils/psString.h	(revision 1406)
+++ trunk/psLib/src/sysUtils/psString.h	(revision 1407)
@@ -1,2 +1,3 @@
+
 /** @file  psString.h
  *
@@ -10,6 +11,6 @@
  *  @author Eric Van Alst, MHPCC
  *
- *  @version $Revision: 1.5 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2004-06-10 01:58:06 $
+ *  @version $Revision: 1.6 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2004-08-07 00:06:06 $
  *
  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -17,15 +18,19 @@
 
 #ifndef PS_STRING_H
-#define PS_STRING_H
+#    define PS_STRING_H
 
 /******************************************************************************/
+
 /*  DEFINE STATEMENTS                                                         */
+
 /******************************************************************************/
 
 /** This macro will convert the arguement to a quoted string */
-#define PS_STRING(S)  #S
+#    define PS_STRING(S)  #S
 
 /******************************************************************************/
+
 /*  TYPE DEFINITIONS                                                          */
+
 /******************************************************************************/
 
@@ -33,8 +38,11 @@
 
 /*****************************************************************************/
+
 /* FUNCTION PROTOTYPES                                                       */
+
 /*****************************************************************************/
 
 // Doxygen group tags
+
 /** @addtogroup SysUtils
  *  @{
@@ -49,8 +57,8 @@
  *
  */
-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
@@ -67,12 +75,15 @@
  *
  */
+
 /*@null@*/
-char *psStringNCopy(
-    const char *str,    /**< Input string of characters to copy */
-    int        nChar    /**< Number of bytes to allocate for string copy */
-);
 
-/* @} */  // Doxygen - End of SystemGroup Functions
+char *psStringNCopy(const char *str,
+                    /**< Input string of characters to copy */
+
+                    int nChar
+                    /**< Number of bytes to allocate for string copy */
+                   );
+
+/* @} */// Doxygen - End of SystemGroup Functions
 
 #endif
-
Index: trunk/psLib/src/sysUtils/psTrace.c
===================================================================
--- trunk/psLib/src/sysUtils/psTrace.c	(revision 1406)
+++ trunk/psLib/src/sysUtils/psTrace.c	(revision 1407)
@@ -1,2 +1,3 @@
+
 /** @file psTrace.c
  *  \brief basic run-time trace facilities
@@ -9,9 +10,10 @@
  *  @author George Gusciora, MHPCC
  *
- *  @version $Revision: 1.14 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2004-08-06 22:34:05 $
+ *  @version $Revision: 1.15 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2004-08-07 00:06:06 $
  *
  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
  */
+
 /*****************************************************************************
     NOTES:
@@ -34,27 +36,27 @@
 #ifndef PS_NO_TRACE
 
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-#include <stdarg.h>
-#include "psMemory.h"
-#include "psTrace.h"
-#include "psString.h"
-#include "psError.h"
-
-static p_psComponent *p_psCroot = NULL;       // The root of the trace component
-static FILE *p_psTraceFP = NULL;          // File destination for messages.
-
-static void componentFree(p_psComponent *comp);
-static p_psComponent *componentAlloc(const char *name,int level);
+#    include <stdlib.h>
+#    include <stdio.h>
+#    include <string.h>
+#    include <stdarg.h>
+#    include "psMemory.h"
+#    include "psTrace.h"
+#    include "psString.h"
+#    include "psError.h"
+
+static p_psComponent *p_psCroot = NULL; // The root of the trace component
+static FILE *p_psTraceFP = NULL;        // File destination for messages.
+
+static void componentFree(p_psComponent * comp);
+static p_psComponent *componentAlloc(const char *name, int level);
 
 /*****************************************************************************
 componentAlloc(): allocate memory for a new node, and initialize members.
  *****************************************************************************/
-static p_psComponent *componentAlloc(const char *name,
-                                     int level)
+static p_psComponent *componentAlloc(const char *name, int level)
 {
     p_psComponent *comp = psAlloc(sizeof(p_psComponent));
-    p_psMemSetDeallocator(comp,(psFreeFcn)componentFree);
+
+    p_psMemSetDeallocator(comp, (psFreeFcn) componentFree);
     comp->name = psStringCopy(name);
     comp->level = level;
@@ -64,10 +66,9 @@
 }
 
-
 /*****************************************************************************
 componentFree(): free the current node in the root tree, and all children
 nodes as well.
  *****************************************************************************/
-static void componentFree(p_psComponent *comp)
+static void componentFree(p_psComponent * comp)
 {
     if (comp == NULL) {
@@ -85,5 +86,4 @@
 }
 
-
 /*****************************************************************************
 initTrace(): simply initialize the component root tree.
@@ -96,9 +96,8 @@
 }
 
-
 /*****************************************************************************
 Set all trace levels to zero.
  *****************************************************************************/
-void p_psTraceReset(p_psComponent *currentNode)
+void p_psTraceReset(p_psComponent * currentNode)
 {
     int i = 0;
@@ -109,9 +108,8 @@
 
     currentNode->level = 0;
-    for (i=0;i<currentNode->n;i++) {
+    for (i = 0; i < currentNode->n; i++) {
         if (NULL == currentNode->subcomp[i]) {
             psError(__func__,
-                    "Sub-component %d of node %s in the trace tree is NULL.\n",
-                    i, currentNode->name);
+                    "Sub-component %d of node %s in the trace tree is NULL.\n", i, currentNode->name);
         } else {
             p_psTraceReset(currentNode->subcomp[i]);
@@ -129,5 +127,4 @@
 }
 
-
 /*****************************************************************************
 Free all nodes in the component tree.
@@ -137,5 +134,4 @@
     psFree(p_psCroot);
 }
-
 
 /*****************************************************************************
@@ -145,15 +141,14 @@
 to ANSI-C.
  *****************************************************************************/
-static void componentAdd(const char *addNodeName,
-                         int         level)
-{
-    int        i = 0;                         // Loop index variable.
-    char       name[strlen(addNodeName) + 1]; // buffer for writeable copy.
-    char      *pname=name;
-    char      *firstComponent = NULL;       // first component of name
+static void componentAdd(const char *addNodeName, int level)
+{
+    int i = 0;                  // Loop index variable.
+    char name[strlen(addNodeName) + 1]; // buffer for writeable copy.
+    char *pname = name;
+    char *firstComponent = NULL;        // first component of name
     p_psComponent *currentNode = p_psCroot;
-    int        nodeExists = 0;
-
-    // Is this the root node?  If so, simply set level and return.
+    int nodeExists = 0;
+
+    // Is this the root node? If so, simply set level and return.
     if (strcmp(".", addNodeName) == 0) {
         p_psCroot->level = level;
@@ -162,6 +157,5 @@
 
     if (addNodeName[0] != '.') {
-        printf("ERROR: failed to add %s to the root component tree.\n",
-               addNodeName);
+        printf("ERROR: failed to add %s to the root component tree.\n", addNodeName);
         exit(1);
     }
@@ -188,13 +182,11 @@
         if (nodeExists == 0) {
             currentNode->subcomp = psRealloc(currentNode->subcomp,
-                                             (currentNode->n + 1) * sizeof(p_psComponent*));
-            currentNode->n = (currentNode->n)+1;
-
-            currentNode->subcomp[(currentNode->n)-1] =
-                componentAlloc(firstComponent, level);
-        }
-    }
-}
-
+                                             (currentNode->n + 1) * sizeof(p_psComponent *));
+            currentNode->n = (currentNode->n) + 1;
+
+            currentNode->subcomp[(currentNode->n) - 1] = componentAlloc(firstComponent, level);
+        }
+    }
+}
 
 /*****************************************************************************
@@ -210,5 +202,5 @@
 *****************************************************************************/
 int psTraceSetLevel(const char *comp,   // component of interest
-                    int level)          // desired trace level
+                    int level)  // desired trace level
 {
     // If the root component tree does not exist, then initialize it.
@@ -216,5 +208,4 @@
         initTrace();
     }
-
     // Add the new component to the component tree.
     componentAdd(comp, level);
@@ -223,5 +214,4 @@
     return 0;
 }
-
 
 /*****************************************************************************
@@ -241,20 +231,20 @@
 static int doGetTraceLevel(const char *aname)
 {
-    char       name[strlen(aname) + 1]; // need a writeable copy: for strsep()
-    char      *pname=name;
-    char      *firstComponent = NULL;   // first component of name
+    char name[strlen(aname) + 1];       // need a writeable copy: for strsep()
+    char *pname = name;
+    char *firstComponent = NULL;        // first component of name
     p_psComponent *currentNode = p_psCroot;
-    int        i = 0;
+    int i = 0;
 
     if (NULL == currentNode) {
-        return(PS_UNKNOWN_TRACE_LEVEL);
+        return (PS_UNKNOWN_TRACE_LEVEL);
     }
 
     if (strcmp(".", aname) == 0) {
-        return(p_psCroot->level);
+        return (p_psCroot->level);
     }
 
     if (aname[0] != '.') {
-        return(PS_UNKNOWN_TRACE_LEVEL);
+        return (PS_UNKNOWN_TRACE_LEVEL);
     }
 
@@ -266,6 +256,5 @@
             if (NULL == currentNode->subcomp[i]) {
                 psError(__func__,
-                        "Sub-component %d of node %s in trace tree is NULL.\n",
-                        i, currentNode->name);
+                        "Sub-component %d of node %s in trace tree is NULL.\n", i, currentNode->name);
             }
 
@@ -273,12 +262,11 @@
                 currentNode = currentNode->subcomp[i];
                 if (pname == NULL) {
-                    return(currentNode->level);
+                    return (currentNode->level);
                 }
             }
         }
     }
-    return(PS_UNKNOWN_TRACE_LEVEL);
-}
-
+    return (PS_UNKNOWN_TRACE_LEVEL);
+}
 
 /*****************************************************************************
@@ -297,11 +285,9 @@
 {
     if (p_psCroot == NULL) {
-        return(PS_UNKNOWN_TRACE_LEVEL);
-    }
-
+        return (PS_UNKNOWN_TRACE_LEVEL);
+    }
     // Search the component root tree, determine the trace level.
-    return(doGetTraceLevel(name));
-}
-
+    return (doGetTraceLevel(name));
+}
 
 /*****************************************************************************
@@ -317,6 +303,5 @@
  null
  *****************************************************************************/
-static void doPrintTraceLevels(const p_psComponent *comp,
-                               int depth)
+static void doPrintTraceLevels(const p_psComponent * comp, int depth)
 {
     int i = 0;
@@ -327,17 +312,14 @@
     } else {
         if (comp->level == PS_UNKNOWN_TRACE_LEVEL) {
-            printf("%*s%-*s %s\n", depth, "", 20 - depth,
-                   comp->name, ".");
+            printf("%*s%-*s %s\n", depth, "", 20 - depth, comp->name, ".");
         } else {
-            printf("%*s%-*s %d\n", depth, "", 20 - depth,
-                   comp->name, comp->level);
+            printf("%*s%-*s %d\n", depth, "", 20 - depth, comp->name, comp->level);
         }
     }
 
     for (i = 0; i < comp->n; i++) {
-        doPrintTraceLevels(comp->subcomp[i], depth+1);
-    }
-}
-
+        doPrintTraceLevels(comp->subcomp[i], depth + 1);
+    }
+}
 
 /*****************************************************************************
@@ -359,5 +341,4 @@
     doPrintTraceLevels(p_psCroot, 0);
 }
-
 
 /*****************************************************************************
@@ -376,6 +357,6 @@
  *****************************************************************************/
 void p_psTrace(const char *comp,        // component being traced
-               int level,               // desired trace level
-               ...)                     // arguments
+               int level,       // desired trace level
+               ...)             // arguments
 {
     char *fmt = NULL;
@@ -384,8 +365,6 @@
 
     if (NULL == comp) {
-        psError(__func__,
-                "p_psTrace() called on a NULL trace level tree\n");
-    }
-
+        psError(__func__, "p_psTrace() called on a NULL trace level tree\n");
+    }
     // Only display this message if it's trace level is less than the level
     // of it's associatedcomponent.
@@ -413,9 +392,8 @@
         va_end(ap);
     }
-
-    // NOTE: should we free *fmt as well?  Read the man page.
-}
-
-void psTraceSetDestination(FILE *fp)
+    // NOTE: should we free *fmt as well? Read the man page.
+}
+
+void psTraceSetDestination(FILE * fp)
 {
     p_psTraceFP = fp;
Index: trunk/psLib/src/sysUtils/psTrace.h
===================================================================
--- trunk/psLib/src/sysUtils/psTrace.h	(revision 1406)
+++ trunk/psLib/src/sysUtils/psTrace.h	(revision 1407)
@@ -1,2 +1,3 @@
+
 /** @file psTrace.h
  *  \brief basic run-time trace facilities
@@ -9,15 +10,14 @@
  *  @author George Gusciora, MHPCC
  *
- *  @version $Revision: 1.11 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2004-08-05 19:38:52 $
+ *  @version $Revision: 1.12 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2004-08-07 00:06:06 $
  *
  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
  */
 #if !defined(PS_TRACE_H)
-#define PS_TRACE_H 1
+#    define PS_TRACE_H 1
 
-#define PS_UNKNOWN_TRACE_LEVEL -9999         // we don't know this name's level
-#define PS_DEFAULT_TRACE_LEVEL 0
-
+#    define PS_UNKNOWN_TRACE_LEVEL -9999   // we don't know this name's level
+#    define PS_DEFAULT_TRACE_LEVEL 0
 
 /** \addtogroup LogTrace
@@ -29,66 +29,65 @@
 //#define PS_NO_TRACE 1   ///< to turn off all tracing
 
-#if defined(PS_NO_TRACE)
-#define psTrace(facil, level, ...) (void)0 /* do nothing */
-#define p_psTrace(facil, level, ...)  (void)0 /* do nothing */
-#define psTraceSetLevel(facil,level) 0
-#define psTraceGetLevel(facil) 0
-#define psTraceReset() (void)0 /* do nothing */
-#define psTraceFree() (void)0 /* do nothing */
-#define psTracePrintLevels() (void)0 /* do nothing */
-#define psTraceSetDestination(fp) (void)0 /* do nothing */
-#else
+#    if defined(PS_NO_TRACE)
+    #        define psTrace(facil, level, ...) (void)0
+    /* do nothing */
+    #        define p_psTrace(facil, level, ...)  (void)0
+    /* do nothing */
+    #        define psTraceSetLevel(facil,level) 0
+    #        define psTraceGetLevel(facil) 0
+    #        define psTraceReset() (void)0     /* do nothing */
+    #        define psTraceFree() (void)0      /* do nothing */
+    #        define psTracePrintLevels() (void)0
+    /* do nothing */
+    #        define psTraceSetDestination(fp) (void)0
+    /* do nothing */
+    #    else
 
-/** Basic structure for the component tree.  A component is a string of the
-    form aaa.bbb.ccc, and may itself contain further subcomponents.  The
-    Component structure doesn't in fact contain it's full name, but only the
-    last part. */
-typedef struct p_psComponent
-{
-    const char *name;                     // last part of name of component
-    int level;                            // trace level for this component
-    int n;                                // number of subcomponents
-    struct p_psComponent **subcomp;           // next level of subcomponents
-}
+        /** Basic structure for the component tree.  A component is a string of the
+            form aaa.bbb.ccc, and may itself contain further subcomponents.  The
+            Component structure doesn't in fact contain it's full name, but only the
+            last part. */
+        typedef struct p_psComponent
+        {
+            const char *name;           // last part of name of component
+            int level;                  // trace level for this component
+            int n;                      // number of subcomponents
+            struct p_psComponent **subcomp;     // next level of subcomponents
+        }
 p_psComponent;
 
-#ifndef DOXYGEN
+#        ifndef DOXYGEN
 /// Send a trace message
-void p_psTrace(const char *facil,  ///< facilty of interest
-               int myLevel,  ///< desired trace level
-               ...)   ///< trace message arguments
+void p_psTrace(const char *facil,       // /< facilty of interest
+               int myLevel,     // /< desired trace level
+               ...)             // /< trace message arguments
 ;
-#endif
+#        endif
 
 /// Set trace level
-int psTraceSetLevel(const char *facil, ///< facilty of interest
-                    int level)  ///< desired trace level
+int psTraceSetLevel(const char *facil,     // /< facilty of interest
+                    int level)     // /< desired trace level
 ;
 
 /// Get the trace level
-int psTraceGetLevel(const char *facil) ///< facilty of interest
+int psTraceGetLevel(const char *facil)     // /< facilty of interest
 ;
 
 /// Set all trace levels to zero (do not free nodes in the component tree).
-void psTraceReset()
-;
+void psTraceReset();
 
 /// Free all nodes in the component tree.
-void psTraceFree()
-;
+void psTraceFree();
 
 /// print trace levels
-void psTracePrintLevels(void)
-;
+void psTracePrintLevels(void);
 
 /// Set the destination of future trace messages.
-void psTraceSetDestination(FILE *fp);
+void psTraceSetDestination(FILE * fp);
 
+/* \} */// End of SystemGroup Functions
 
-/* \} */ // End of SystemGroup Functions
-
-#define psTrace(facil, level, ...) p_psTrace(facil, level, __VA_ARGS__)
-#endif
+#        define psTrace(facil, level, ...) p_psTrace(facil, level, __VA_ARGS__)
+#    endif
 
 #endif
-
Index: trunk/psLib/src/sysUtils/psType.h
===================================================================
--- trunk/psLib/src/sysUtils/psType.h	(revision 1406)
+++ trunk/psLib/src/sysUtils/psType.h	(revision 1407)
@@ -1,2 +1,3 @@
+
 /** @file  psType.h
 *
@@ -10,6 +11,6 @@
 *  @author Ross Harman, MHPCC
 *
-*  @version $Revision: 1.16 $ $Name: not supported by cvs2svn $
-*  @date $Date: 2004-08-04 23:37:39 $
+*  @version $Revision: 1.17 $ $Name: not supported by cvs2svn $
+*  @date $Date: 2004-08-07 00:06:06 $
 *
 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -17,9 +18,9 @@
 
 #ifndef PS_TYPE_H
-#define PS_TYPE_H
+#    define PS_TYPE_H
 
-#include <complex.h>
-#include <stdint.h>
-#include <float.h>
+#    include <complex.h>
+#    include <stdint.h>
+#    include <float.h>
 
 /// @addtogroup DataContainer
@@ -27,5 +28,7 @@
 
 /******************************************************************************/
+
 /*  TYPE DEFINITIONS                                                          */
+
 /******************************************************************************/
 
@@ -37,74 +40,75 @@
  */
 
-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"
+typedef psU8 psMaskType;        // /< the C datatype for a mask image
 
-#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
+#    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
 
-#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_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
 
 /// Macro to get the bad pixel reason code (stored as part of mask value)
-#define PS_BADPIXEL_BITMASK 0x0f
-#define PS_GET_BADPIXEL(maskValue) (maskValue & PS_BADPIXEL_BITMASK)
+#    define PS_BADPIXEL_BITMASK 0x0f
+#    define PS_GET_BADPIXEL(maskValue) (maskValue & PS_BADPIXEL_BITMASK)
 
-#define PS_IS_BADPIXEL(maskValue) (PS_GET_BADPIXEL(maskValue) != 0)
+#    define PS_IS_BADPIXEL(maskValue) (PS_GET_BADPIXEL(maskValue) != 0)
 
 /// Macro to apply a bad pixel reason code to mask image
-#define PS_SET_BADPIXEL(maskValue, reasonCode) \
+#    define PS_SET_BADPIXEL(maskValue, reasonCode) \
 { \
     maskValue = (psMaskType)((reasonCode & PS_BADPIXEL_BITMASK) | (maskValue & ~PS_BADPIXEL_BITMASK)); \
@@ -112,13 +116,13 @@
 
 /// Macro to determine if the psElemType is an integer.
-#define PS_IS_PSELEMTYPE_INT(x) ((x & 0x100) == 0x100)
+#    define PS_IS_PSELEMTYPE_INT(x) ((x & 0x100) == 0x100)
 /// Macro to determine if the psElemType is unsigned.
-#define PS_IS_PSELEMTYPE_UNSIGNED(x) ((x & 0x200) == 0x200)
+#    define PS_IS_PSELEMTYPE_UNSIGNED(x) ((x & 0x200) == 0x200)
 /// Macro to determine if the psElemType is a real (non-complex) floating-point type.
-#define PS_IS_PSELEMTYPE_REAL(x) ((x & 0x400) == 0x400)
+#    define PS_IS_PSELEMTYPE_REAL(x) ((x & 0x400) == 0x400)
 /// Macro to determine if the psElemType is complex number type.
-#define PS_IS_PSELEMTYPE_COMPLEX(x) ((x & 0x800) == 0x800)
+#    define PS_IS_PSELEMTYPE_COMPLEX(x) ((x & 0x800) == 0x800)
 /// Macro to determine the storage size, in bytes, of the psElemType.
-#define PSELEMTYPE_SIZEOF(x) ( (x==PS_TYPE_PTR) ? sizeof(void*) :(x & 0xFF) )
+#    define PSELEMTYPE_SIZEOF(x) ( (x==PS_TYPE_PTR) ? sizeof(void*) :(x & 0xFF) )
 
 /** Dimensions of a data type.
@@ -128,9 +132,9 @@
  */
 typedef enum {
-    PS_DIMEN_SCALAR,     ///< Scalar.
-    PS_DIMEN_VECTOR,     ///< Vector.
-    PS_DIMEN_TRANSV,     ///< Transposed vector.
-    PS_DIMEN_IMAGE,      ///< Image.
-    PS_DIMEN_OTHER      ///< Something else that's not supported for arithmetic.
+    PS_DIMEN_SCALAR,            // /< Scalar.
+    PS_DIMEN_VECTOR,            // /< Vector.
+    PS_DIMEN_TRANSV,            // /< Transposed vector.
+    PS_DIMEN_IMAGE,             // /< Image.
+    PS_DIMEN_OTHER              // /< Something else that's not supported for arithmetic.
 } psDimen;
 
@@ -143,6 +147,6 @@
 typedef struct
 {
-    psElemType type;    ///< Primitive type.
-    psDimen dimen;      ///< Dimensionality.
+    psElemType type;            // /< Primitive type.
+    psDimen dimen;              // /< Dimensionality.
 }
 psType;
