Index: trunk/psLib/src/collections/psArray.c
===================================================================
--- trunk/psLib/src/collections/psArray.c	(revision 1406)
+++ trunk/psLib/src/collections/psArray.c	(revision 1407)
@@ -1,2 +1,3 @@
+
 /** @file  psArray.c
  *
@@ -8,6 +9,6 @@
  *  @author Ross Harman, MHPCC
  *
- *  @version $Revision: 1.11 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2004-08-06 22:34:05 $
+ *  @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
@@ -15,7 +16,9 @@
 
 /******************************************************************************/
+
 /*  INCLUDE FILES                                                             */
+
 /******************************************************************************/
-#include<stdlib.h>            // for qsort, etc.
+#include<stdlib.h>                         // for qsort, etc.
 
 #include "psMemory.h"
@@ -24,26 +27,28 @@
 #include "psLogMsg.h"
 
+/*****************************************************************************/
+
+/*  FUNCTION IMPLEMENTATION - LOCAL                                          */
 
 /*****************************************************************************/
-/*  FUNCTION IMPLEMENTATION - LOCAL                                          */
-/*****************************************************************************/
-static void arrayFree(psArray *restrict psArr);
+static void arrayFree(psArray * restrict psArr);
 
 /*****************************************************************************/
+
 /* FUNCTION IMPLEMENTATION - PUBLIC                                          */
+
 /*****************************************************************************/
-psArray* psArrayAlloc(unsigned int nalloc)
+psArray *psArrayAlloc(unsigned int nalloc)
 {
     psArray *psArr = NULL;
 
     // Invalid nalloc
-    if(nalloc < 1) {
+    if (nalloc < 1) {
         psError(__func__, "Invalid value for nalloc. nalloc: %d\n", nalloc);
         return NULL;
     }
-
     // Create vector struct
-    psArr = (psArray *)psAlloc(sizeof(psArray));
-    p_psMemSetDeallocator(psArr,(psFreeFcn)arrayFree);
+    psArr = (psArray *) psAlloc(sizeof(psArray));
+    p_psMemSetDeallocator(psArr, (psFreeFcn) arrayFree);
 
     psArr->nalloc = nalloc;
@@ -51,38 +56,36 @@
 
     // Create vector data array
-    psArr->data = psAlloc(nalloc*sizeof(psPTR));
+    psArr->data = psAlloc(nalloc * sizeof(psPTR));
 
     return psArr;
 }
 
-psArray *psArrayRealloc(unsigned int nalloc, psArray *restrict in)
+psArray *psArrayRealloc(unsigned int nalloc, psArray * restrict in)
 {
     // Invalid nalloc
-    if(nalloc < 1) {
+    if (nalloc < 1) {
         psError(__func__, "Invalid value for realloc (%d)\n", nalloc);
         return NULL;
     }
 
-    if(in == NULL) {
+    if (in == NULL) {
         psError(__func__, "Null input vector\n");
         return NULL;
-    } else
-        if(in->nalloc != nalloc) {                    // No need to realloc to same size
-            if(nalloc < in->n) {
-                for (int i = nalloc; i < in->n; i++) {   // For reduction in vector size
-                    psFree(in->data[i]);
-                }
-                in->n = nalloc;
+    } else if (in->nalloc != nalloc) {     // No need to realloc to same size
+        if (nalloc < in->n) {
+            for (int i = nalloc; i < in->n; i++) {      // For reduction in vector size
+                psFree(in->data[i]);
             }
-
-            // Realloc after decrementation to avoid accessing freed array elements
-            in->data = psRealloc(in->data,nalloc*sizeof(psPTR));
-            in->nalloc = nalloc;
+            in->n = nalloc;
         }
+        // Realloc after decrementation to avoid accessing freed array elements
+        in->data = psRealloc(in->data, nalloc * sizeof(psPTR));
+        in->nalloc = nalloc;
+    }
 
     return in;
 }
 
-static void arrayFree(psArray *restrict psArr)
+static void arrayFree(psArray * restrict psArr)
 {
     if (psArr == NULL) {
@@ -95,12 +98,12 @@
 }
 
-void psArrayElementFree(psArray *restrict psArr)
+void psArrayElementFree(psArray * restrict psArr)
 {
 
-    if(psArr == NULL) {
+    if (psArr == NULL) {
         return;
     }
 
-    for(int i = 0; i < psArr->n; i++) {
+    for (int i = 0; i < psArr->n; i++) {
         psFree(psArr->data[i]);
         psArr->data[i] = NULL;
@@ -108,5 +111,5 @@
 }
 
-psArray* psArraySort(psArray* in, psComparePtrFcn compare)
+psArray *psArraySort(psArray * in, psComparePtrFcn compare)
 {
     if (in == NULL) {
@@ -114,7 +117,5 @@
     }
 
-    qsort(in->data, in->n, sizeof(psPTR),
-          (int(*)(const void *, const void *))compare);
-
+    qsort(in->data, in->n, sizeof(psPTR), (int (*)(const void *, const void *))compare);
 
     return in;
Index: trunk/psLib/src/collections/psArray.h
===================================================================
--- trunk/psLib/src/collections/psArray.h	(revision 1406)
+++ trunk/psLib/src/collections/psArray.h	(revision 1407)
@@ -1,2 +1,3 @@
+
 /** @file  psArray.h
  *
@@ -11,6 +12,6 @@
  *  @author Ross Harman, MHPCC
  *
- *  @version $Revision: 1.11 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2004-07-15 22:18:02 $
+ *  @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
@@ -18,8 +19,8 @@
 
 #ifndef PS_ARRAY_H
-#define PS_ARRAY_H
+#    define PS_ARRAY_H
 
-#include "psType.h"
-#include "psCompare.h"
+#    include "psType.h"
+#    include "psCompare.h"
 
 /// @addtogroup Array
@@ -33,12 +34,14 @@
 typedef struct
 {
-    unsigned int nalloc;                ///< Total number of elements available.
-    unsigned int n;                     ///< Number of elements in use.
-    psPTR* data;                        ///< An Array of pointer elements
+    unsigned int nalloc;        // /< Total number of elements available.
+    unsigned int n;             // /< Number of elements in use.
+    psPTR *data;                // /< An Array of pointer elements
 }
 psArray;
 
 /*****************************************************************************/
+
 /* FUNCTION PROTOTYPES                                                       */
+
 /*****************************************************************************/
 
@@ -51,7 +54,6 @@
  *
  */
-psArray *psArrayAlloc(
-    unsigned int nalloc                 ///< Total number of elements to make available.
-);
+psArray *psArrayAlloc(unsigned int nalloc       // /< Total number of elements to make available.
+                     );
 
 /** Reallocate an array.
@@ -63,8 +65,7 @@
  *
  */
-psArray *psArrayRealloc(
-    unsigned int nalloc,                ///< Total number of elements to make available.
-    psArray *restrict psArr            ///< array to reallocate.
-);
+psArray *psArrayRealloc(unsigned int nalloc,    // /< Total number of elements to make available.
+                        psArray * restrict psArr        // /< array to reallocate.
+                       );
 
 /** Deallocate/Dereference elements of an array.
@@ -75,7 +76,6 @@
  *
  */
-void psArrayElementFree(
-    psArray *restrict psArr    ///< Void pointer array to destroy.
-);
+void psArrayElementFree(psArray * restrict psArr        // /< Void pointer array to destroy.
+                       );
 
 /** Sort the array according to an external compare function.
@@ -86,5 +86,5 @@
  *  @return psArray*       The sorted array.
  */
-psArray* psArraySort(psArray* in, psComparePtrFcn compare);
+psArray *psArraySort(psArray * in, psComparePtrFcn compare);
 
 /// @}
Index: trunk/psLib/src/collections/psBitSet.c
===================================================================
--- trunk/psLib/src/collections/psBitSet.c	(revision 1406)
+++ trunk/psLib/src/collections/psBitSet.c	(revision 1407)
@@ -1,2 +1,3 @@
+
 /** @file  psBitSet.c
  *
@@ -10,6 +11,6 @@
  *  @author Ross Harman, 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
@@ -17,5 +18,7 @@
 
 /******************************************************************************/
+
 /*  INCLUDE FILES                                                             */
+
 /******************************************************************************/
 #include <string.h>
@@ -31,32 +34,41 @@
 
 /******************************************************************************/
+
 /*  DEFINE STATEMENTS                                                         */
-/******************************************************************************/
-
-// None
-
-/******************************************************************************/
+
+/******************************************************************************/
+
+// None
+
+/******************************************************************************/
+
 /*  TYPE DEFINITIONS                                                          */
-/******************************************************************************/
-
-// None
-
-/*****************************************************************************/
+
+/******************************************************************************/
+
+// None
+
+/*****************************************************************************/
+
 /*  GLOBAL VARIABLES                                                         */
-/*****************************************************************************/
-
-// None
-
-/*****************************************************************************/
+
+/*****************************************************************************/
+
+// None
+
+/*****************************************************************************/
+
 /*  FILE STATIC VARIABLES                                                    */
-/*****************************************************************************/
-
-// None
-
-/*****************************************************************************/
+
+/*****************************************************************************/
+
+// None
+
+/*****************************************************************************/
+
 /*  FUNCTION IMPLEMENTATION - LOCAL                                          */
-/*****************************************************************************/
-static void psBitSetFree(psBitSet *restrict inBitSet);
-
+
+/*****************************************************************************/
+static void psBitSetFree(psBitSet * restrict inBitSet);
 
 /** Private function to create a mask.
@@ -70,7 +82,8 @@
 {
     char mask = (char)0x01;
+
     // Ignore splint warning about negative bit shifts
-    /*@i@*/
-    mask = mask << (bit%8);
+    /* @i@ */
+    mask = mask << (bit % 8);
 
     return mask;
@@ -78,29 +91,31 @@
 
 /*****************************************************************************/
+
 /* FUNCTION IMPLEMENTATION - PUBLIC                                          */
-/*****************************************************************************/
-psBitSet* psBitSetAlloc(int n)
+
+/*****************************************************************************/
+psBitSet *psBitSetAlloc(int n)
 {
     int numBytes = 0;
     psBitSet *newObj = NULL;
 
-    if(n <= 0) {
+    if (n <= 0) {
         psError(__func__, " : Line %d - Allocation size must be > 0: size = %d", __LINE__, n);
         return 0;
     }
 
-    numBytes = ceil(n/8.0);
+    numBytes = ceil(n / 8.0);
     newObj = psAlloc(sizeof(psBitSet));
-    if(newObj == NULL) {
-        psAbort(__func__," : Line %d - Failed to allocate memory", __LINE__);
-    }
-    p_psMemSetDeallocator(newObj,(psFreeFcn)psBitSetFree);
+    if (newObj == NULL) {
+        psAbort(__func__, " : Line %d - Failed to allocate memory", __LINE__);
+    }
+    p_psMemSetDeallocator(newObj, (psFreeFcn) psBitSetFree);
     newObj->n = numBytes;
 
     // Ignore splint warning about releasing pointer members, since they've not been allocated yet
-    /*@i@*/
-    newObj->bits = psAlloc(sizeof(char)*numBytes);
-    if(newObj->bits == NULL) {
-        psAbort(__func__," : Line %d - Failed to allocate memory", __LINE__);
+    /* @i@ */
+    newObj->bits = psAlloc(sizeof(char) * numBytes);
+    if (newObj->bits == NULL) {
+        psAbort(__func__, " : Line %d - Failed to allocate memory", __LINE__);
     }
 
@@ -110,7 +125,7 @@
 }
 
-static void psBitSetFree(psBitSet *restrict inBitSet)
-{
-    if(inBitSet == NULL) {
+static void psBitSetFree(psBitSet * restrict inBitSet)
+{
+    if (inBitSet == NULL) {
         psError(__func__, " : Line %d - Null psBitSet for inBitSet argument", __LINE__);
         return;
@@ -119,23 +134,20 @@
 }
 
-psBitSet* psBitSetSet(psBitSet *inBitSet, int bit)
-{
-    char* byte = NULL;
-
-    if(inBitSet == NULL) {
+psBitSet *psBitSetSet(psBitSet * inBitSet, int bit)
+{
+    char *byte = NULL;
+
+    if (inBitSet == NULL) {
         psError(__func__, " : Line %d - Null psBitSet for inBitSet argument", __LINE__);
         return inBitSet;
-    } else
-        if(bit < 0) {
-            psError(__func__, " : Line %d - Bit position too small: %d", __LINE__, bit);
-            return inBitSet;
-        } else
-            if(bit > inBitSet->n*8-1) {
-                psError(__func__, " : Line %d - Bit position too large: %d", __LINE__, bit);
-                return inBitSet;
-            }
-
+    } else if (bit < 0) {
+        psError(__func__, " : Line %d - Bit position too small: %d", __LINE__, bit);
+        return inBitSet;
+    } else if (bit > inBitSet->n * 8 - 1) {
+        psError(__func__, " : Line %d - Bit position too large: %d", __LINE__, bit);
+        return inBitSet;
+    }
     // Variable byte is the byte in the array that contains the bit to be set
-    byte = inBitSet->bits+bit/8;
+    byte = inBitSet->bits + bit / 8;
     *byte |= mask(bit);
 
@@ -143,24 +155,21 @@
 }
 
-bool psBitSetTest(const psBitSet *inBitSet, int bit)
-{
-    char* byte = NULL;
-
-    if(inBitSet == NULL) {
-        psError(__func__, " : Line %d - Null psBitSet for inBitSet argument", __LINE__);
-        return 0;
-    } else
-        if(bit < 0) {
-            psError(__func__, " : Line %d - Bit position too small: %d", __LINE__, bit);
-            return 0;
-        } else
-            if(bit > inBitSet->n*8-1) {
-                psError(__func__, " : Line %d - Bit position too large: %d", __LINE__, bit);
-                return 0;
-            }
-
+bool psBitSetTest(const psBitSet * inBitSet, int bit)
+{
+    char *byte = NULL;
+
+    if (inBitSet == NULL) {
+        psError(__func__, " : Line %d - Null psBitSet for inBitSet argument", __LINE__);
+        return 0;
+    } else if (bit < 0) {
+        psError(__func__, " : Line %d - Bit position too small: %d", __LINE__, bit);
+        return 0;
+    } else if (bit > inBitSet->n * 8 - 1) {
+        psError(__func__, " : Line %d - Bit position too large: %d", __LINE__, bit);
+        return 0;
+    }
     // Variable byte is the byte in the array that contains the bit to be tested
-    byte = inBitSet->bits+bit/8;
-    if((int)(*byte&mask(bit)) == 0) {
+    byte = inBitSet->bits + bit / 8;
+    if ((int)(*byte & mask(bit)) == 0) {
         return 0;
     }
@@ -169,6 +178,6 @@
 }
 
-psBitSet* psBitSetOp(psBitSet *outBitSet, const psBitSet *restrict inBitSet1, char *operator,
-                     const psBitSet *restrict inBitSet2)
+psBitSet *psBitSetOp(psBitSet * outBitSet, const psBitSet * restrict inBitSet1, char *operator,
+                     const psBitSet * restrict inBitSet2)
 {
     int i = 0;
@@ -179,24 +188,24 @@
     char *inBits2 = NULL;
 
-    if(inBitSet1 == NULL) {
+    if (inBitSet1 == NULL) {
         psError(__func__, " : Line %d - Null psBitSet for inBitSet1 argument", __LINE__);
         return outBitSet;
     }
 
-    if(operator == NULL) {
+    if (operator == NULL) {
         psError(__func__, " : Line %d - Null input operator\n", __LINE__);
         return outBitSet;
     }
 
-    if(inBitSet2 == NULL) {
+    if (inBitSet2 == NULL) {
         psError(__func__, " : Line %d - Null psBitSet for inBitSet2 argument", __LINE__);
         return outBitSet;
     }
 
-    if(outBitSet == NULL) {
-        outBitSet = psBitSetAlloc(inBitSet1->n*8);
-    }
-
-    if(inBitSet1->n != inBitSet2->n || outBitSet->n != inBitSet1->n) {
+    if (outBitSet == NULL) {
+        outBitSet = psBitSetAlloc(inBitSet1->n * 8);
+    }
+
+    if (inBitSet1->n != inBitSet2->n || outBitSet->n != inBitSet1->n) {
         psError(__func__, " : Line %d - psBitSet sizes not the same", __LINE__);
         return outBitSet;
@@ -209,17 +218,17 @@
 
     tempChar = toupper(operator[0]);
-    switch(tempChar) {
+    switch (tempChar) {
     case 'A':
-        for(i=0; i<n; i++) {
+        for (i = 0; i < n; i++) {
             outBits[i] = inBits1[i] & inBits2[i];
         }
         break;
     case 'O':
-        for(i=0; i<n; i++) {
+        for (i = 0; i < n; i++) {
             outBits[i] = inBits1[i] | inBits2[i];
         }
         break;
     case 'X':
-        for(i=0; i<n; i++) {
+        for (i = 0; i < n; i++) {
             outBits[i] = inBits1[i] ^ inBits2[i];
         }
@@ -232,5 +241,5 @@
 }
 
-psBitSet* psBitSetNot(psBitSet *outBitSet, const psBitSet *restrict inBitSet)
+psBitSet *psBitSetNot(psBitSet * outBitSet, const psBitSet * restrict inBitSet)
 {
     int i = 0;
@@ -239,5 +248,5 @@
     char *inBits = NULL;
 
-    if(inBitSet == NULL) {
+    if (inBitSet == NULL) {
         psError(__func__, " : Line %d - Null psBitSet for inBitSet argument", __LINE__);
         return outBitSet;
@@ -245,14 +254,14 @@
 
     n = inBitSet->n;
-    if(n == 0) {
+    if (n == 0) {
         psError(__func__, " : Line %d - No elements in inBitSet", __LINE__);
         return outBitSet;
     }
 
-    if(outBitSet == NULL) {
-        outBitSet = psBitSetAlloc(n*8);
-    }
-
-    if(inBitSet->n != outBitSet->n) {
+    if (outBitSet == NULL) {
+        outBitSet = psBitSetAlloc(n * 8);
+    }
+
+    if (inBitSet->n != outBitSet->n) {
         psError(__func__, " : Line %d - psBitSet sizes not the same", __LINE__);
         return outBitSet;
@@ -262,5 +271,5 @@
     inBits = inBitSet->bits;
 
-    for(i=0; i<n; i++) {
+    for (i = 0; i < n; i++) {
         outBits[i] = ~inBits[i];
     }
@@ -269,15 +278,16 @@
 }
 
-char *psBitSetToString(const psBitSet *restrict inBitSet)
+char *psBitSetToString(const psBitSet * restrict inBitSet)
 {
     int i = 0;
-    int numBits = inBitSet->n*8;
-    char* outString = psAlloc((size_t)numBits+1);
-    if(outString == NULL) {
-        psAbort(__func__," : Line %d - Failed to allocate memory", __LINE__);
-    }
-
-    for(i=0; i<numBits; i++) {
-        outString[numBits-i-1] = (psBitSetTest(inBitSet, i) == 1)?'1':'0';
+    int numBits = inBitSet->n * 8;
+    char *outString = psAlloc((size_t) numBits + 1);
+
+    if (outString == NULL) {
+        psAbort(__func__, " : Line %d - Failed to allocate memory", __LINE__);
+    }
+
+    for (i = 0; i < numBits; i++) {
+        outString[numBits - i - 1] = (psBitSetTest(inBitSet, i) == 1) ? '1' : '0';
     }
 
Index: trunk/psLib/src/collections/psBitSet.h
===================================================================
--- trunk/psLib/src/collections/psBitSet.h	(revision 1406)
+++ trunk/psLib/src/collections/psBitSet.h	(revision 1407)
@@ -1,2 +1,3 @@
+
 /** @file  psBitSet.h
  *
@@ -12,6 +13,6 @@
  *  @author Ross Harman, MHPCC
  *
- *  @version $Revision: 1.9 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2004-07-01 21:48:11 $
+ *  @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
@@ -19,5 +20,5 @@
 
 #ifndef PSBITSET_H
-#define PSBITSET_H
+#    define PSBITSET_H
 
 /// @addtogroup BitSet
@@ -25,5 +26,7 @@
 
 /******************************************************************************/
+
 /*  TYPE DEFINITIONS                                                          */
+
 /******************************************************************************/
 
@@ -35,5 +38,7 @@
 typedef struct
 {
+
     int n;      /**< Number of bytes in the array */
+
     char *bits; /**< Aray of bytes holding bits */
 }
@@ -41,5 +46,7 @@
 
 /*****************************************************************************/
+
 /* FUNCTION PROTOTYPES                                                       */
+
 /*****************************************************************************/
 
@@ -51,8 +58,10 @@
  *  @return  psBitSet*: Pointer to struct containing array of bits and size of array.
  */
+
 /*@null@*/
-psBitSet* psBitSetAlloc(
-    int n   /**< Number of bits in psBitSet array */
-);
+
+psBitSet *psBitSetAlloc(int n
+                        /**< Number of bits in psBitSet array */
+                       );
 
 /** Set a bit.
@@ -64,7 +73,10 @@
  *  @return  psBitSet*: Pointer to struct containing psBitSet.
  */
-psBitSet* psBitSetSet(
-    /*@returned@*/psBitSet *restrict inMask,  /**< Pointer to psBitSet to be set. */
-    int bit                     /**< Bit to be set. */
+psBitSet *psBitSetSet(
+
+    /* @returned@ */ psBitSet * restrict inMask,
+    /**< Pointer to psBitSet to be set. */
+
+    int bit/**< Bit to be set. */
 );
 
@@ -78,8 +90,10 @@
  *  @return  int: Value of bit, either one or zero.
  */
-bool psBitSetTest(
-    const psBitSet *restrict inMask,    /**< Pointer psBitSet to be tested. */
-    int bit                             /**< Bit to be tested. */
-);
+
+bool psBitSetTest(const psBitSet * restrict inMask,
+                  /**< Pointer psBitSet to be tested. */
+
+                  int bit               /**< Bit to be tested. */
+                 );
 
 /** Perform a binary operation on two psBitSets
@@ -90,9 +104,16 @@
  *  @return  psBitSet*: Pointer to struct containing result of binary operation.
  */
-psBitSet* psBitSetOp(
-    /*@returned@*/psBitSet *restrict outMask,   /**< Resulting psBitSet from binary operation */
-    const psBitSet *restrict inMask1,           /**< First psBitSet on which to operate */
-    char *operator,                             /**< Bit operation */
-    const psBitSet *restrict inMask2            /**< First psBitSet on which to operate */
+psBitSet *psBitSetOp(
+
+    /* @returned@ */ psBitSet * restrict outMask,
+    /**< Resulting psBitSet from binary operation */
+
+    const psBitSet * restrict inMask1,
+    /**< First psBitSet on which to operate */
+
+    char *operator,         /**< Bit operation */
+
+    const psBitSet * restrict inMask2
+    /**< First psBitSet on which to operate */
 );
 
@@ -103,8 +124,11 @@
  *  @return  psBitSet*: Pointer to struct containing result of operation.
  */
-psBitSet* psBitSetNot(
-    psBitSet *outBitSet,                /**< Resulting psBitSet from operation */
-    const psBitSet *restrict inBitSet   /**< Input psBitSet */
-);
+
+psBitSet *psBitSetNot(psBitSet * outBitSet,
+                      /**< Resulting psBitSet from operation */
+
+                      const psBitSet * restrict inBitSet
+                      /**< Input psBitSet */
+                     );
 
 /** Convert the psBitSet to a string of ones and zeros.
@@ -115,7 +139,8 @@
  *  @return  char*: Pointer to character array containing string data.
  */
-char *psBitSetToString(
-    const psBitSet *restrict inMask /**< psBitSet to convert */
-);
+
+char *psBitSetToString(const psBitSet * restrict inMask
+                       /**< psBitSet to convert */
+                      );
 
 /// @}
Index: trunk/psLib/src/collections/psCompare.c
===================================================================
--- trunk/psLib/src/collections/psCompare.c	(revision 1406)
+++ trunk/psLib/src/collections/psCompare.c	(revision 1407)
@@ -1,2 +1,3 @@
+
 /** @file psCompare.c
  *  @brief Comparison functions for sorting routines
@@ -6,6 +7,6 @@
  *  @author Robert Daniel DeSonia, MHPCC
  *
- *  @version $Revision: 1.3 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2004-08-05 19:38:52 $
+ *  @version $Revision: 1.4 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2004-08-07 00:06:06 $
  *
  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
Index: trunk/psLib/src/collections/psCompare.h
===================================================================
--- trunk/psLib/src/collections/psCompare.h	(revision 1406)
+++ trunk/psLib/src/collections/psCompare.h	(revision 1407)
@@ -1,4 +1,4 @@
 #if !defined(PS_COMPARE_H)
-#define PS_COMPARE_H
+#    define PS_COMPARE_H
 
 /** @file psCompare.h
@@ -9,6 +9,6 @@
  *  @ingroup Compare
  *
- *  @version $Revision: 1.1 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2004-06-28 20:36:37 $
+ *  @version $Revision: 1.2 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2004-08-07 00:06:06 $
  *
  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -26,5 +26,5 @@
  *                   than, equal to, or greater than the second. 
  */
-typedef int (*psComparePtrFcn)(const void** a, const void** b);
+typedef int (*psComparePtrFcn) (const void **a, const void **b);
 
 /** A comparison function for sorting.
@@ -34,5 +34,5 @@
  *                   than, equal to, or greater than the second. 
  */
-typedef int (*psCompareFcn)(const void* a, const void* b);
+typedef int (*psCompareFcn) (const void *a, const void *b);
 
 /** Compare function of psS8 data.  For use with psListSort.
@@ -42,5 +42,5 @@
  *                   than, equal to, or greater than the second. 
  */
-int psCompareS8Ptr(const void** a, const void** b);
+int psCompareS8Ptr(const void **a, const void **b);
 
 /** Compare function of psS16 data.  For use with psListSort.
@@ -50,5 +50,5 @@
  *                   than, equal to, or greater than the second. 
  */
-int psCompareS16Ptr(const void** a, const void** b);
+int psCompareS16Ptr(const void **a, const void **b);
 
 /** Compare function of psS32 data.  For use with psListSort.
@@ -58,5 +58,5 @@
  *                   than, equal to, or greater than the second. 
  */
-int psCompareS32Ptr(const void** a, const void** b);
+int psCompareS32Ptr(const void **a, const void **b);
 
 /** Compare function of psS64 data.  For use with psListSort.
@@ -66,5 +66,5 @@
  *                   than, equal to, or greater than the second. 
  */
-int psCompareS64Ptr(const void** a, const void** b);
+int psCompareS64Ptr(const void **a, const void **b);
 
 /** Compare function of psU8 data.  For use with psListSort.
@@ -74,5 +74,5 @@
  *                   than, equal to, or greater than the second. 
  */
-int psCompareU8Ptr(const void** a, const void** b);
+int psCompareU8Ptr(const void **a, const void **b);
 
 /** Compare function of psU16 data.  For use with psListSort.
@@ -82,5 +82,5 @@
  *                   than, equal to, or greater than the second. 
  */
-int psCompareU16Ptr(const void** a, const void** b);
+int psCompareU16Ptr(const void **a, const void **b);
 
 /** Compare function of psU32 data.  For use with psListSort.
@@ -90,5 +90,5 @@
  *                   than, equal to, or greater than the second. 
  */
-int psCompareU32Ptr(const void** a, const void** b);
+int psCompareU32Ptr(const void **a, const void **b);
 
 /** Compare function of psU64 data.  For use with psListSort.
@@ -98,5 +98,5 @@
  *                   than, equal to, or greater than the second. 
  */
-int psCompareU64Ptr(const void** a, const void** b);
+int psCompareU64Ptr(const void **a, const void **b);
 
 /** Compare function of psF32 data.  For use with psListSort.
@@ -106,5 +106,5 @@
  *                   than, equal to, or greater than the second. 
  */
-int psCompareF32Ptr(const void** a, const void** b);
+int psCompareF32Ptr(const void **a, const void **b);
 
 /** Compare function of psF64 data.  For use with psListSort.
@@ -114,5 +114,5 @@
  *                   than, equal to, or greater than the second. 
  */
-int psCompareF64Ptr(const void** a, const void** b);
+int psCompareF64Ptr(const void **a, const void **b);
 
 /** Compare function of psS8 data.  For use with psListSort for descending ordering.
@@ -122,5 +122,5 @@
  *                   than, equal to, or less than the second. 
  */
-int psCompareDescendingS8Ptr(const void** a, const void** b);
+int psCompareDescendingS8Ptr(const void **a, const void **b);
 
 /** Compare function of psS16 data.  For use with psListSort for descending ordering.
@@ -130,5 +130,5 @@
  *                   than, equal to, or less than the second. 
  */
-int psCompareDescendingS16Ptr(const void** a, const void** b);
+int psCompareDescendingS16Ptr(const void **a, const void **b);
 
 /** Compare function of psS32 data.  For use with psListSort for descending ordering.
@@ -138,5 +138,5 @@
  *                   than, equal to, or less than the second. 
  */
-int psCompareDescendingS32Ptr(const void** a, const void** b);
+int psCompareDescendingS32Ptr(const void **a, const void **b);
 
 /** Compare function of psS64 data.  For use with psListSort for descending ordering.
@@ -146,5 +146,5 @@
  *                   than, equal to, or less than the second. 
  */
-int psCompareDescendingS64Ptr(const void** a, const void** b);
+int psCompareDescendingS64Ptr(const void **a, const void **b);
 
 /** Compare function of psU8 data.  For use with psListSort for descending ordering.
@@ -154,5 +154,5 @@
  *                   than, equal to, or less than the second. 
  */
-int psCompareDescendingU8Ptr(const void** a, const void** b);
+int psCompareDescendingU8Ptr(const void **a, const void **b);
 
 /** Compare function of psU16 data.  For use with psListSort for descending ordering.
@@ -162,5 +162,5 @@
  *                   than, equal to, or less than the second. 
  */
-int psCompareDescendingU16Ptr(const void** a, const void** b);
+int psCompareDescendingU16Ptr(const void **a, const void **b);
 
 /** Compare function of psU32 data.  For use with psListSort for descending ordering.
@@ -170,5 +170,5 @@
  *                   than, equal to, or lessg than the second. 
  */
-int psCompareDescendingU32Ptr(const void** a, const void** b);
+int psCompareDescendingU32Ptr(const void **a, const void **b);
 
 /** Compare function of psU64 data.  For use with psListSort for descending ordering.
@@ -178,5 +178,5 @@
  *                   than, equal to, or lessg than the second. 
  */
-int psCompareDescendingU64Ptr(const void** a, const void** b);
+int psCompareDescendingU64Ptr(const void **a, const void **b);
 
 /** Compare function of psF32 data.  For use with psListSort for descending ordering.
@@ -186,5 +186,5 @@
  *                   than, equal to, or lessg than the second. 
  */
-int psCompareDescendingF32Ptr(const void** a, const void** b);
+int psCompareDescendingF32Ptr(const void **a, const void **b);
 
 /** Compare function of psF64 data.  For use with psListSort for descending ordering.
@@ -194,5 +194,5 @@
  *                   than, equal to, or lessg than the second. 
  */
-int psCompareDescendingF64Ptr(const void** a, const void** b);
+int psCompareDescendingF64Ptr(const void **a, const void **b);
 
 /** Compare function of psS8 data.
@@ -202,5 +202,5 @@
  *                   than, equal to, or greater than the second. 
  */
-int psCompareS8(const void* a, const void* b);
+int psCompareS8(const void *a, const void *b);
 
 /** Compare function of psS16 data.
@@ -210,5 +210,5 @@
  *                   than, equal to, or greater than the second. 
  */
-int psCompareS16(const void* a, const void* b);
+int psCompareS16(const void *a, const void *b);
 
 /** Compare function of psS32 data.
@@ -218,5 +218,5 @@
  *                   than, equal to, or greater than the second. 
  */
-int psCompareS32(const void* a, const void* b);
+int psCompareS32(const void *a, const void *b);
 
 /** Compare function of psS64 data.
@@ -226,5 +226,5 @@
  *                   than, equal to, or greater than the second. 
  */
-int psCompareS64(const void* a, const void* b);
+int psCompareS64(const void *a, const void *b);
 
 /** Compare function of psU8 data.
@@ -234,5 +234,5 @@
  *                   than, equal to, or greater than the second. 
  */
-int psCompareU8(const void* a, const void* b);
+int psCompareU8(const void *a, const void *b);
 
 /** Compare function of psU16 data.
@@ -242,5 +242,5 @@
  *                   than, equal to, or greater than the second. 
  */
-int psCompareU16(const void* a, const void* b);
+int psCompareU16(const void *a, const void *b);
 
 /** Compare function of psU32 data.
@@ -250,5 +250,5 @@
  *                   than, equal to, or greater than the second. 
  */
-int psCompareU32(const void* a, const void* b);
+int psCompareU32(const void *a, const void *b);
 
 /** Compare function of psU64 data.
@@ -258,5 +258,5 @@
  *                   than, equal to, or greater than the second. 
  */
-int psCompareU64(const void* a, const void* b);
+int psCompareU64(const void *a, const void *b);
 
 /** Compare function of psF32 data.
@@ -266,5 +266,5 @@
  *                   than, equal to, or greater than the second. 
  */
-int psCompareF32(const void* a, const void* b);
+int psCompareF32(const void *a, const void *b);
 
 /** Compare function of psF64 data.
@@ -274,5 +274,5 @@
  *                   than, equal to, or greater than the second. 
  */
-int psCompareF64(const void* a, const void* b);
+int psCompareF64(const void *a, const void *b);
 
 /** Compare function of psS8 data.
@@ -282,5 +282,5 @@
  *                   than, equal to, or less than the second. 
  */
-int psCompareDescendingS8(const void* a, const void* b);
+int psCompareDescendingS8(const void *a, const void *b);
 
 /** Compare function of psS16 data.
@@ -290,5 +290,5 @@
  *                   than, equal to, or less than the second. 
  */
-int psCompareDescendingS16(const void* a, const void* b);
+int psCompareDescendingS16(const void *a, const void *b);
 
 /** Compare function of psS32 data.
@@ -298,5 +298,5 @@
  *                   than, equal to, or less than the second. 
  */
-int psCompareDescendingS32(const void* a, const void* b);
+int psCompareDescendingS32(const void *a, const void *b);
 
 /** Compare function of psS64 data.
@@ -306,5 +306,5 @@
  *                   than, equal to, or less than the second. 
  */
-int psCompareDescendingS64(const void* a, const void* b);
+int psCompareDescendingS64(const void *a, const void *b);
 
 /** Compare function of psU8 data.
@@ -314,5 +314,5 @@
  *                   than, equal to, or less than the second. 
  */
-int psCompareDescendingU8(const void* a, const void* b);
+int psCompareDescendingU8(const void *a, const void *b);
 
 /** Compare function of psU16 data.
@@ -322,5 +322,5 @@
  *                   than, equal to, or less than the second. 
  */
-int psCompareDescendingU16(const void* a, const void* b);
+int psCompareDescendingU16(const void *a, const void *b);
 
 /** Compare function of psU32 data.
@@ -330,5 +330,5 @@
  *                   than, equal to, or lessg than the second. 
  */
-int psCompareDescendingU32(const void* a, const void* b);
+int psCompareDescendingU32(const void *a, const void *b);
 
 /** Compare function of psU64 data.
@@ -338,5 +338,5 @@
  *                   than, equal to, or lessg than the second. 
  */
-int psCompareDescendingU64(const void* a, const void* b);
+int psCompareDescendingU64(const void *a, const void *b);
 
 /** Compare function of psF32 data.
@@ -346,5 +346,5 @@
  *                   than, equal to, or lessg than the second. 
  */
-int psCompareDescendingF32(const void* a, const void* b);
+int psCompareDescendingF32(const void *a, const void *b);
 
 /** Compare function of psF64 data.
@@ -354,7 +354,5 @@
  *                   than, equal to, or lessg than the second. 
  */
-int psCompareDescendingF64(const void* a, const void* b);
-
-
+int psCompareDescendingF64(const void *a, const void *b);
 
 /// @}
Index: trunk/psLib/src/collections/psList.c
===================================================================
--- trunk/psLib/src/collections/psList.c	(revision 1406)
+++ trunk/psLib/src/collections/psList.c	(revision 1407)
@@ -1,2 +1,3 @@
+
 /** @file psList.c
  *  @brief Support for doubly linked lists
@@ -6,6 +7,6 @@
  *  @author Robert Daniel DeSonia, MHPCC
  *
- *  @version $Revision: 1.13 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2004-08-06 22:34:05 $
+ *  @version $Revision: 1.14 $ $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,5 @@
 #include <stdbool.h>
 #include <stdio.h>
-#include <pthread.h>                   // we need a mutex to make this stuff thread safe.
+#include <pthread.h>                       // we need a mutex to make this stuff thread safe.
 
 #include "psError.h"
@@ -24,18 +25,18 @@
 #include "psLogMsg.h"
 
-#define ITER_INIT_HEAD ((void *)1) // next iteration should return head
-#define ITER_INIT_TAIL ((void *)2) // next iteration should return tail
+#define ITER_INIT_HEAD ((void *)1)         // next iteration should return head
+#define ITER_INIT_TAIL ((void *)2)         // next iteration should return tail
 
 // private functions.
-static psListElem* listGetIterator(psList* list);
-static int listGetIteratorIndex(psList* list);
-static void listSetIterator(psList *list, int where, bool lockList);
-static void listFree(psList *list);
-
+static psListElem *listGetIterator(psList * list);
+static int listGetIteratorIndex(psList * list);
+static void listSetIterator(psList * list, int where, bool lockList);
+static void listFree(psList * list);
 
 psList *psListAlloc(void *data)
 {
     psList *list = psAlloc(sizeof(psList));
-    p_psMemSetDeallocator(list,(psFreeFcn)listFree);
+
+    p_psMemSetDeallocator(list, (psFreeFcn) listFree);
 
     list->size = 0;
@@ -44,5 +45,5 @@
     list->iterIndex = PS_LIST_HEAD;
 
-    pthread_mutex_init(&(list->lock),NULL)
+    pthread_mutex_init(&(list->lock), NULL)
     ;
 
@@ -54,5 +55,5 @@
 }
 
-static void listFree(psList *list)
+static void listFree(psList * list)
 {
     if (list == NULL) {
@@ -63,5 +64,5 @@
     ;
 
-    for(psListElem *ptr = list->head; ptr != NULL; ) {
+    for (psListElem * ptr = list->head; ptr != NULL;) {
         psListElem *next = ptr->next;
 
@@ -80,8 +81,8 @@
 }
 
-bool psListAdd(psList *list, void *data, int where)
-{
-    psListElem* position;
-    psListElem* elem;
+bool psListAdd(psList * list, void *data, int where)
+{
+    psListElem *position;
+    psListElem *elem;
     int cursorIndex = 0;
 
@@ -95,8 +96,6 @@
 
     if (where <= PS_LIST_UNKNOWN) {
-        /// XXX What is the better way to communicate this failure to the caller?
-        psLogMsg(__func__,PS_LOG_WARN,
-                 "The given insert location (%i) for psListAdd is invalid.",
-                 where);
+        // / XXX What is the better way to communicate this failure to the caller?
+        psLogMsg(__func__, PS_LOG_WARN, "The given insert location (%i) for psListAdd is invalid.", where);
         return false;
     }
@@ -108,7 +107,6 @@
 
     if (where > 0 && where > list->size) {
-        psLogMsg(__func__,PS_LOG_WARN,
-                 "Invalid index %d (only %d elements in psList); assuming tail.",
-                 where, list->size);
+        psLogMsg(__func__, PS_LOG_WARN,
+                 "Invalid index %d (only %d elements in psList); assuming tail.", where, list->size);
         where = PS_LIST_TAIL;
     }
@@ -138,8 +136,7 @@
 
         if (position == NULL) {
-            psError(__func__,"%s failed to move cursor to specified location (%d)",__func__,where);
-            position = list->head; // since we no list->size != 0, this must be non-NULL
-        }
-
+            psError(__func__, "%s failed to move cursor to specified location (%d)", __func__, where);
+            position = list->head;         // since we no list->size != 0, this must be non-NULL
+        }
         // insert our new element in front of the given position
         elem->prev = position->prev;
@@ -147,5 +144,5 @@
         position->prev = elem;
 
-        if (elem->prev == NULL) { // must be front of list
+        if (elem->prev == NULL) {          // must be front of list
             list->head = elem;
         } else {
@@ -167,17 +164,17 @@
 
 /*****************************************************************************/
+
 /*
  * Remove an element from a list
  */
-bool psListRemove(psList *list, void *data,  int which)
-{
-    psListElem *elem = NULL;  // element to remove
+bool psListRemove(psList * list, void *data, int which)
+{
+    psListElem *elem = NULL;    // element to remove
     int cursorIndex = 0;
 
     if (list == NULL) {
-        psError(__func__,"list parameter found to be NULL in %s",__func__);
+        psError(__func__, "list parameter found to be NULL in %s", __func__);
         return false;
     }
-
     // get exclusive access to list so that other threads will not get in the way.
     pthread_mutex_lock(&list->lock)
@@ -187,6 +184,7 @@
         // search list for the data item.
 
-        int i = 0;   // index
-        for (psListElem *ptr = list->head; ptr != NULL; ptr = ptr->next) {
+        int i = 0;              // index
+
+        for (psListElem * ptr = list->head; ptr != NULL; ptr = ptr->next) {
             if (ptr->data == data) {
                 which = i;
@@ -201,12 +199,11 @@
         }
     }
-
     // position the list's cursor to the desired location
-    listSetIterator(list,which,false);
+    listSetIterator(list, which, false);
     elem = listGetIterator(list);
     cursorIndex = listGetIteratorIndex(list);
 
     if (elem == NULL) {
-        psError(__func__, "Couldn't position to given index (%d) to remove element from list.",which);
+        psError(__func__, "Couldn't position to given index (%d) to remove element from list.", which);
         return false;
     }
@@ -214,5 +211,5 @@
     list->size--;
 
-    if (elem->prev == NULL) { // head of list?
+    if (elem->prev == NULL) {              // head of list?
         list->head = elem->next;
     } else {
@@ -220,5 +217,5 @@
     }
 
-    if (elem->next == NULL) { // tail of list?
+    if (elem->next == NULL) {              // tail of list?
         list->tail = elem->prev;
 
@@ -246,16 +243,16 @@
 }
 
-void psListSetIterator(psList *list, int where)
-{
-    listSetIterator(list,where,true);
-}
-
-void listSetIterator(psList* list, int where, bool lockList)
-{
-    psListElem* cursor;
+void psListSetIterator(psList * list, int where)
+{
+    listSetIterator(list, where, true);
+}
+
+void listSetIterator(psList * list, int where, bool lockList)
+{
+    psListElem *cursor;
     int position;
 
     if (list == NULL) {
-        psError(__func__,"Unexpected null pointer for psList parameter (%s:%d).",__FILE__,__LINE__);
+        psError(__func__, "Unexpected null pointer for psList parameter (%s:%d).", __FILE__, __LINE__);
         return;
     }
@@ -291,5 +288,5 @@
         if (cursor != NULL) {
             list->iter = cursor->prev;
-            list->iterIndex = position-1;
+            list->iterIndex = position - 1;
         }
         break;
@@ -301,5 +298,5 @@
         if (cursor != NULL) {
             list->iter = cursor->next;
-            list->iterIndex = position+1;
+            list->iterIndex = position + 1;
         }
         break;
@@ -309,9 +306,9 @@
 
     default:
-        if (where <= PS_LIST_HEAD) { // bascially same as PS_LIST_UNKNOWN above
-            psError(__func__,"Can't move to an unknown position.  Not moving the iterator position.");
+        if (where <= PS_LIST_HEAD) {   // bascially same as PS_LIST_UNKNOWN above
+            psError(__func__, "Can't move to an unknown position.  Not moving the iterator position.");
         } else {
             cursor = listGetIterator(list);
-            if (cursor == NULL) { // reset the iterator if it is invalid
+            if (cursor == NULL) {      // reset the iterator if it is invalid
                 list->iter = ITER_INIT_HEAD;
                 list->iterIndex = 0;
@@ -321,12 +318,14 @@
 
             if (where < position) {
-                int diff = position-where;
-                for (int count=0;count < diff; count++) {
-                    listSetIterator(list,PS_LIST_PREVIOUS,false);
+                int diff = position - where;
+
+                for (int count = 0; count < diff; count++) {
+                    listSetIterator(list, PS_LIST_PREVIOUS, false);
                 }
             } else {
-                int diff = where-position;
-                for (int count=0;count < diff; count++) {
-                    listSetIterator(list,PS_LIST_NEXT,false);
+                int diff = where - position;
+
+                for (int count = 0; count < diff; count++) {
+                    listSetIterator(list, PS_LIST_NEXT, false);
                 }
             }
@@ -341,5 +340,5 @@
 }
 
-psListElem* listGetIterator(psList* list)
+psListElem *listGetIterator(psList * list)
 {
     if (list == NULL) {
@@ -349,29 +348,27 @@
     if (list->iter == ITER_INIT_HEAD) {
         return list->head;
-    } else
-        if (list->iter == ITER_INIT_TAIL) {
-            return list->tail;
-        } else {
-            return list->iter;
-        }
-}
-
-int listGetIteratorIndex(psList* list)
+    } else if (list->iter == ITER_INIT_TAIL) {
+        return list->tail;
+    } else {
+        return list->iter;
+    }
+}
+
+int listGetIteratorIndex(psList * list)
 {
     if (list->iter == ITER_INIT_HEAD) {
         return 0;
-    } else
-        if (list->iter == ITER_INIT_TAIL) {
-            return list->size-1;
-        } else {
-            return list->iterIndex;
-        }
-}
-
-void* psListGet(psList* list,int which)
-{
-    psListElem* element;
-
-    psListSetIterator(list,which);
+    } else if (list->iter == ITER_INIT_TAIL) {
+        return list->size - 1;
+    } else {
+        return list->iterIndex;
+    }
+}
+
+void *psListGet(psList * list, int which)
+{
+    psListElem *element;
+
+    psListSetIterator(list, which);
     element = listGetIterator(list);
 
@@ -382,18 +379,19 @@
     }
 }
+
 /*
  * and now return the previous/next element of the list
  */
-void *psListGetNext(psList *list)
+void *psListGetNext(psList * list)
 {
     return psListGet(list, PS_LIST_NEXT);
 }
 
-void *psListGetPrevious(psList *list)
+void *psListGetPrevious(psList * list)
 {
     return psListGet(list, PS_LIST_PREVIOUS);
 }
 
-void *psListGetCurrent(psList *list)
+void *psListGetCurrent(psList * list)
 {
     return psListGet(list, PS_LIST_CURRENT);
@@ -403,9 +401,9 @@
  * Convert a psList to/from a psVoidPtrArray
  */
-psArray* psListToArray(psList* restrict list)
-{
-    psListElem* ptr;
+psArray *psListToArray(psList * restrict list)
+{
+    psListElem *ptr;
     unsigned int n;
-    psArray* restrict arr;
+    psArray *restrict arr;
 
     if (list == NULL) {
@@ -431,8 +429,8 @@
 }
 
-psList* psArrayToList(psArray* arr)
+psList *psArrayToList(psArray * arr)
 {
     unsigned int n;
-    psList* list; // list of elements
+    psList *list;               // list of elements
 
     if (arr == NULL) {
@@ -443,5 +441,5 @@
     n = arr->n;
     for (int i = 0; i < n; i++) {
-        psListAdd(list,arr->data[i],PS_LIST_TAIL);
+        psListAdd(list, arr->data[i], PS_LIST_TAIL);
     }
 
@@ -449,17 +447,16 @@
 }
 
-
-psList* psListSort(psList* list, psComparePtrFcn compare)
-{
-    psArray* arr;
+psList *psListSort(psList * list, psComparePtrFcn compare)
+{
+    psArray *arr;
+
     if (list == NULL) {
         return NULL;
     }
-
     // convert to indexable vector for use by qsort.
     arr = psListToArray(list);
     psFree(list);
 
-    arr = psArraySort(arr,compare);
+    arr = psArraySort(arr, compare);
 
     // convert back to linked list
Index: trunk/psLib/src/collections/psList.h
===================================================================
--- trunk/psLib/src/collections/psList.h	(revision 1406)
+++ trunk/psLib/src/collections/psList.h	(revision 1407)
@@ -1,4 +1,4 @@
 #if !defined(PS_LIST_H)
-#define PS_LIST_H
+#    define PS_LIST_H
 
 /** @file psList.h
@@ -10,15 +10,15 @@
  *  @ingroup LinkedList
  *
- *  @version $Revision: 1.9 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2004-07-15 22:18:02 $
+ *  @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
  */
 
-#include <pthread.h>                   // we need a mutex to make this stuff thread safe.
-#include <stdbool.h>                   // we use the bool type.
+#    include <pthread.h>                   // we need a mutex to make this stuff thread safe.
+#    include <stdbool.h>                   // we use the bool type.
 
-#include "psCompare.h"
-#include "psArray.h"
+#    include "psCompare.h"
+#    include "psArray.h"
 
 /** @addtogroup LinkedList
@@ -33,10 +33,10 @@
  */
 enum {
-    PS_LIST_HEAD = 0,                  ///< at head
-    PS_LIST_TAIL = -1,                 ///< at tail
-    PS_LIST_PREVIOUS = -2,             ///< previous element
-    PS_LIST_CURRENT = -3,              ///< current element
-    PS_LIST_NEXT = -4,                 ///< next element
-    PS_LIST_UNKNOWN = -5               ///< unknown position (should be last in enum list)
+    PS_LIST_HEAD = 0,           // /< at head
+    PS_LIST_TAIL = -1,                     // /< at tail
+    PS_LIST_PREVIOUS = -2,                 // /< previous element
+    PS_LIST_CURRENT = -3,                  // /< current element
+    PS_LIST_NEXT = -4,                     // /< next element
+    PS_LIST_UNKNOWN = -5                   // /< unknown position (should be last in enum list)
 };
 
@@ -44,7 +44,7 @@
 typedef struct psListElem
 {
-    struct psListElem *prev;            ///< previous link in list
-    struct psListElem *next;            ///< next link in list
-    void *data;                         ///< real data item
+    struct psListElem *prev;    // /< previous link in list
+    struct psListElem *next;    // /< next link in list
+    void *data;                 // /< real data item
 }
 psListElem;
@@ -57,10 +57,10 @@
 typedef struct
 {
-    unsigned int size;                  ///< number of elements on list
-    psListElem* head;                   ///< first element on list (may be NULL)
-    psListElem* tail;                   ///< last element on list (may be NULL)
-    psListElem* iter;                   ///< iteration cursor
-    unsigned int iterIndex;             ///< the numeric position of the iteration cursor in the list
-    pthread_mutex_t lock;               ///< mutex to lock a node during changes
+    unsigned int size;          // /< number of elements on list
+    psListElem *head;           // /< first element on list (may be NULL)
+    psListElem *tail;           // /< last element on list (may be NULL)
+    psListElem *iter;           // /< iteration cursor
+    unsigned int iterIndex;     // /< the numeric position of the iteration cursor in the list
+    pthread_mutex_t lock;       // /< mutex to lock a node during changes
 }
 psList;
@@ -70,8 +70,7 @@
  *  @return psList*     A new psList object.
  */
-psList* psListAlloc(
-    void *data
-    ///< initial data item; may be NULL if no an empty psList is desired
-)
+psList *psListAlloc(void *data
+                    // /< initial data item; may be NULL if no an empty psList is desired
+                   )
 ;
 
@@ -81,9 +80,8 @@
  *                      NULL, the return value will also be NULL.
  */
-bool psListAdd(
-    psList* restrict list,              ///< list to add to (if NULL, nothing is done)
-    void* data,                         ///< data item to add.  If NULL, list is not modified.
-    int where                           ///< index, PS_LIST_HEAD, PS_LIST_TAIL, or numbered location.
-);
+bool psListAdd(psList * restrict list,  // /< list to add to (if NULL, nothing is done)
+               void *data,      // /< data item to add.  If NULL, list is not modified.
+               int where        // /< index, PS_LIST_HEAD, PS_LIST_TAIL, or numbered location.
+              );
 
 /** Remove an item from a list.  If which parameter is PS_LIST_UNKNOWN,
@@ -91,12 +89,11 @@
  *  @return bool        TRUE if element is successfully removed, otherwise FALSE.
  */
-bool psListRemove(
-    psList* restrict list,
-    ///< list to remove element from
-    void *data,
-    ///< if which is PS_LIST_UNKNOWN, data item to find and remove, otherwise this is ignored.
-    int which
-    ///< index of item, or PS_LIST_UNKNOWN, PS_LIST_NEXT, PS_LIST_PREV, or numbered location.
-);
+bool psListRemove(psList * restrict list,
+                  // /< list to remove element from
+                  void *data,
+                  // /< if which is PS_LIST_UNKNOWN, data item to find and remove, otherwise this is ignored.
+                  int which
+                  // /< index of item, or PS_LIST_UNKNOWN, PS_LIST_NEXT, PS_LIST_PREV, or numbered location.
+                 );
 
 /** Retrieve an item from a list.
@@ -107,8 +104,7 @@
  *                      NULL is returned.
  */
-void* psListGet(
-    psList* restrict list,             ///< list to retrieve element from
-    int which                          ///< index number, or PS_LIST_NEXT, PS_LIST_PREV, PS_LIST_UNKNOWN
-);
+void *psListGet(psList * restrict list, // /< list to retrieve element from
+                int which       // /< index number, or PS_LIST_NEXT, PS_LIST_PREV, PS_LIST_UNKNOWN
+               );
 
 /** Set the iterator of the list to a given position.  If where is invalid the
@@ -116,8 +112,7 @@
  *
  */
-void psListSetIterator(
-    psList* restrict list,             ///< list to retrieve element from
-    int where                           ///< index number, PS_LIST_HEAD, or PS_LIST_TAIL
-);
+void psListSetIterator(psList * restrict list,  // /< list to retrieve element from
+                       int where        // /< index number, PS_LIST_HEAD, or PS_LIST_TAIL
+                      );
 
 /** Get next element relative to the iterator.  This also moves the iterator to
@@ -128,7 +123,6 @@
  *                      parameter was NULL.
  */
-void* psListGetNext(
-    psList* restrict list              ///< list to retrieve element from
-);
+void *psListGetNext(psList * restrict list      // /< list to retrieve element from
+                   );
 
 /** Get current element according to the psList's iterator cursor.  This does
@@ -139,7 +133,6 @@
  *                      iterator is not valid or list parameter was NULL.
  */
-void* psListGetCurrent(
-    psList* restrict list              ///< list to retrieve element from
-);
+void *psListGetCurrent(psList * restrict list   // /< list to retrieve element from
+                      );
 
 /** Get previous element relative to list's iterator. This also moves the
@@ -150,7 +143,6 @@
  *                      parameter was NULL.
  */
-void* psListGetPrevious(
-    psList* restrict list              ///< list to retrieve element from
-);
+void *psListGetPrevious(psList * restrict list  // /< list to retrieve element from
+                       );
 
 /** Convert a linked list to an array
@@ -159,7 +151,6 @@
  *                      or NULL if the given dlist parameter is NULL.
  */
-psArray* psListToArray(
-    psList *dlist                      ///< List to convert
-);
+psArray *psListToArray(psList * dlist   // /< List to convert
+                      );
 
 /** Convert array to a doubly-linked list
@@ -168,12 +159,10 @@
  *                      or NULL is the given arr parameter is NULL.
  */
-psList* psArrayToList(
-    psArray* arr                      ///< vector to convert
-);
+psList *psArrayToList(psArray * arr     // /< vector to convert
+                     );
 
-psList* psListSort(psList* list, psComparePtrFcn compare);
+psList *psListSort(psList * list, psComparePtrFcn compare);
 
 /// @} End of DataGroup Functions
 
 #endif
-
Index: trunk/psLib/src/collections/psMetadata.c
===================================================================
--- trunk/psLib/src/collections/psMetadata.c	(revision 1406)
+++ trunk/psLib/src/collections/psMetadata.c	(revision 1407)
@@ -1,2 +1,3 @@
+
 /** @file  psMetadata.c
 *
@@ -11,6 +12,6 @@
 *  @author Ross Harman, 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
@@ -18,5 +19,7 @@
 
 /******************************************************************************/
+
 /*  INCLUDE FILES                                                             */
+
 /******************************************************************************/
 #include<stdio.h>
@@ -34,7 +37,8 @@
 #include "psString.h"
 
-
 /******************************************************************************/
+
 /*  DEFINE STATEMENTS                                                         */
+
 /******************************************************************************/
 
@@ -56,5 +60,7 @@
 
 /******************************************************************************/
+
 /*  TYPE DEFINITIONS                                                          */
+
 /******************************************************************************/
 
@@ -62,5 +68,7 @@
 
 /*****************************************************************************/
+
 /*  GLOBAL VARIABLES                                                         */
+
 /*****************************************************************************/
 
@@ -68,5 +76,7 @@
 
 /*****************************************************************************/
+
 /*  FILE STATIC VARIABLES                                                    */
+
 /*****************************************************************************/
 
@@ -74,7 +84,9 @@
 
 /*****************************************************************************/
+
 /*  FUNCTION IMPLEMENTATION - LOCAL                                          */
-/*****************************************************************************/
-static void metadataItemFree( psMetadataItem *metadataItem )
+
+/*****************************************************************************/
+static void metadataItemFree(psMetadataItem * metadataItem)
 {
     psMetadataType type;
@@ -82,36 +94,35 @@
     type = metadataItem->type;
 
-    if(metadataItem == NULL) {
-        return ;
-    }
-
-    psFree( metadataItem->name );
-    psFree( metadataItem->comment );
-    psFree( metadataItem->items );
-
-    if(type == PS_META_STR ||
+    if (metadataItem == NULL) {
+        return;
+    }
+
+    psFree(metadataItem->name);
+    psFree(metadataItem->comment);
+    psFree(metadataItem->items);
+
+    if (type == PS_META_STR ||
             type == PS_META_IMG ||
-            type == PS_META_JPEG ||
-            type == PS_META_PNG ||
-            type == PS_META_ASTROM ||
-            type == PS_META_UNKNOWN) {
-        psFree( metadataItem->data.V );
-    }
-}
-
-static void metadataFree( psMetadata *metadata )
-{
-    if(metadata == NULL) {
-        return ;
-    }
-    psFree( metadata->list );
-    psFree( metadata->table );
-}
-
-/*****************************************************************************/
+            type == PS_META_JPEG || type == PS_META_PNG || type == PS_META_ASTROM || type == PS_META_UNKNOWN) {
+        psFree(metadataItem->data.V);
+    }
+}
+
+static void metadataFree(psMetadata * metadata)
+{
+    if (metadata == NULL) {
+        return;
+    }
+    psFree(metadata->list);
+    psFree(metadata->table);
+}
+
+/*****************************************************************************/
+
 /* FUNCTION IMPLEMENTATION - PUBLIC                                          */
-/*****************************************************************************/
-
-psMetadataItem *psMetadataItemAlloc( const char *name, psMetadataType type, const char *comment, ... )
+
+/*****************************************************************************/
+
+psMetadataItem *psMetadataItemAlloc(const char *name, psMetadataType type, const char *comment, ...)
 {
     va_list argPtr;
@@ -119,44 +130,43 @@
 
     // Get the variable list parameters to pass to allocation function
-    va_start( argPtr, comment );
+    va_start(argPtr, comment);
 
     // Call metadata item allocation
-    metadataItem = psMetadataItemAllocV( name, type, comment, argPtr );
+    metadataItem = psMetadataItemAllocV(name, type, comment, argPtr);
 
     // Clean up stack after variable arguement has been used
-    va_end( argPtr );
+    va_end(argPtr);
 
     return metadataItem;
 }
 
-psMetadataItem *psMetadataItemAllocV( const char *name, psMetadataType type, const char *comment, va_list argPtr )
-{
-    psMetadataItem * metadataItem = NULL;
-
-    if(name == NULL) {
-        psError( __func__, "Null value for name not allowed" );
-        return NULL;
-    }
-
+psMetadataItem *psMetadataItemAllocV(const char *name, psMetadataType type, const char *comment,
+                                     va_list argPtr)
+{
+    psMetadataItem *metadataItem = NULL;
+
+    if (name == NULL) {
+        psError(__func__, "Null value for name not allowed");
+        return NULL;
+    }
     // Allocate metadata item
-    metadataItem = ( psMetadataItem * ) psAlloc( sizeof( psMetadataItem ) );
-    if(metadataItem == NULL) {
-        psAbort( __func__, "Failed to allocate memory" );
-    }
-
+    metadataItem = (psMetadataItem *) psAlloc(sizeof(psMetadataItem));
+    if (metadataItem == NULL) {
+        psAbort(__func__, "Failed to allocate memory");
+    }
     // Set deallocator
-    p_psMemSetDeallocator( metadataItem, ( psFreeFcn ) metadataItemFree );
+    p_psMemSetDeallocator(metadataItem, (psFreeFcn) metadataItemFree);
 
     // Allocate and set metadata item comment
-    metadataItem->comment = ( char * ) psAlloc( sizeof( char ) * MAX_STRING_LENGTH );
-    if(comment == NULL) {
+    metadataItem->comment = (char *)psAlloc(sizeof(char) * MAX_STRING_LENGTH);
+    if (comment == NULL) {
         // Per SDRS, null isn't allowed, must use "" instead
-        strncpy( metadataItem->comment, "", MAX_STRING_LENGTH );
+        strncpy(metadataItem->comment, "", MAX_STRING_LENGTH);
     } else {
-        strncpy( metadataItem->comment, comment, MAX_STRING_LENGTH );
+        strncpy(metadataItem->comment, comment, MAX_STRING_LENGTH);
     }
 
     // Set metadata item unique id
-    *( int* ) ( &metadataItem->id ) = ++metadataId;
+    *(int *)(&metadataItem->id) = ++metadataId;
 
     // Set metadata item type
@@ -164,19 +174,21 @@
 
     // Set metadata item value
-    switch(type) {
+    switch (type) {
     case PS_META_BOOL:
-        metadataItem->data.B = ( bool ) va_arg( argPtr, int );
+        metadataItem->data.B = (bool) va_arg(argPtr, int);
+
         break;
     case PS_META_S32:
-        metadataItem->data.S32 = va_arg( argPtr, psS32 );
+        metadataItem->data.S32 = va_arg(argPtr, psS32);
         break;
     case PS_META_F32:
-        metadataItem->data.F32 = ( psF32 ) va_arg( argPtr, psF64 );
+        metadataItem->data.F32 = (psF32) va_arg(argPtr, psF64);
         break;
     case PS_META_F64:
-        metadataItem->data.F64 = va_arg( argPtr, psF64 );
+        metadataItem->data.F64 = va_arg(argPtr, psF64);
         break;
     case PS_META_STR:
-        metadataItem->data.V = psStringNCopy( va_arg( argPtr, char* ), MAX_STRING_LENGTH );
+        metadataItem->data.V = psStringNCopy(va_arg(argPtr, char *), MAX_STRING_LENGTH);
+
         break;
     case PS_META_IMG:
@@ -186,41 +198,40 @@
     case PS_META_UNKNOWN:
     default:
-        psError( __func__, "Invalid psMetadataType: %d", type );
+        psError(__func__, "Invalid psMetadataType: %d", type);
     }
 
     // Allocate and set metadata item name
-    metadataItem->name = ( char * ) psAlloc( sizeof( char ) * MAX_STRING_LENGTH );
-    vsprintf( metadataItem->name, name, argPtr );
+    metadataItem->name = (char *)psAlloc(sizeof(char) * MAX_STRING_LENGTH);
+    vsprintf(metadataItem->name, name, argPtr);
 
     // Allocate metadata items with same name.
-    metadataItem->items = psListAlloc( NULL );
+    metadataItem->items = psListAlloc(NULL);
 
     return metadataItem;
 }
 
-psMetadata *psMetadataAlloc( void )
-{
-    psList * list = NULL;
+psMetadata *psMetadataAlloc(void)
+{
+    psList *list = NULL;
     psHash *table = NULL;
     psMetadata *metadata = NULL;
 
     // Allocate metadata
-    metadata = ( psMetadata * ) psAlloc( sizeof( psMetadata ) );
-    if(metadata == NULL) {
-        psAbort( __func__, "Failed to allocate metadata" );
-    }
-
+    metadata = (psMetadata *) psAlloc(sizeof(psMetadata));
+    if (metadata == NULL) {
+        psAbort(__func__, "Failed to allocate metadata");
+    }
     // Set deallocator
-    p_psMemSetDeallocator( metadata, ( psFreeFcn ) metadataFree );
+    p_psMemSetDeallocator(metadata, (psFreeFcn) metadataFree);
 
     // Allocate metadata's internal containers
-    list = ( psList * ) psListAlloc( NULL );
-    if(list == NULL) {
-        psAbort( __func__, "Failed to allocate list" );
-    }
-
-    table = ( psHash * ) psHashAlloc( 10 );
-    if(table == NULL) {
-        psAbort( __func__, "Failed to allocate table" );
+    list = (psList *) psListAlloc(NULL);
+    if (list == NULL) {
+        psAbort(__func__, "Failed to allocate list");
+    }
+
+    table = (psHash *) psHashAlloc(10);
+    if (table == NULL) {
+        psAbort(__func__, "Failed to allocate table");
     }
 
@@ -231,7 +242,7 @@
 }
 
-bool psMetadataAddItem( psMetadata *restrict md, int where, psMetadataItem *restrict metadataItem )
-{
-    char * key = NULL;
+bool psMetadataAddItem(psMetadata * restrict md, int where, psMetadataItem * restrict metadataItem)
+{
+    char *key = NULL;
     psHash *mdTable = NULL;
     psList *mdList = NULL;
@@ -239,11 +250,11 @@
     psMetadataType type = PS_META_ITEM_SET;
 
-    if(md == NULL) {
-        psError( __func__, "Null metadata collection not allowed" );
-        return false;
-    }
-
-    if(metadataItem == NULL) {
-        psError( __func__, "Null metadata item not allowed" );
+    if (md == NULL) {
+        psError(__func__, "Null metadata collection not allowed");
+        return false;
+    }
+
+    if (metadataItem == NULL) {
+        psError(__func__, "Null metadata item not allowed");
         return false;
     }
@@ -252,54 +263,51 @@
 
     mdTable = md->table;
-    if(mdTable == NULL) {
-        psError( __func__, "Null metadata table not allowed" );
-        return false;
-    }
-
-    mdList = md->list;
-    if(mdList == NULL) {
-        psError( __func__, "Null metadata list not allowed" );
+    if (mdTable == NULL) {
+        psError(__func__, "Null metadata table not allowed");
+        return false;
+    }
+
+    mdList = md->list;
+    if (mdList == NULL) {
+        psError(__func__, "Null metadata list not allowed");
         return false;
     }
 
     key = metadataItem->name;
-    if(key == NULL) {
-        psError( __func__, "Null key item not allowed" );
-        return false;
-    }
-
+    if (key == NULL) {
+        psError(__func__, "Null key item not allowed");
+        return false;
+    }
     // Check if key is already in table
-    value = ( psMetadataItem* ) psHashLookup( mdTable, key );
-    if(value != NULL && type != PS_META_ITEM_SET) {
+    value = (psMetadataItem *) psHashLookup(mdTable, key);
+    if (value != NULL && type != PS_META_ITEM_SET) {
 
         // The key was found and the new metadata item is a leaf node (its type isn't PS_META_ITEM_SET), so
         // add the new metadata item to hash as a child of the existing metadata item folder node.
-        if(!psListAdd( value->items, metadataItem, where )) {
-            psError( __func__, "Couldn't add metadata item to items list. Name: %s",
-                     metadataItem->name );
+        if (!psListAdd(value->items, metadataItem, where)) {
+            psError(__func__, "Couldn't add metadata item to items list. Name: %s", metadataItem->name);
             return false;
         }
-    } else
-        if(value != NULL) {
-
-            // The key was found and the new metadata item is a folder node. Don't add new metadata item, since
-            // it will wipe out existing node.
-            psError( __func__, "Metadata already exists in metadata collection. Item not added. Name: %s",
-                     metadataItem->name );
+    } else if (value != NULL) {
+
+        // The key was found and the new metadata item is a folder node. Don't add new metadata item, since
+        // it will wipe out existing node.
+        psError(__func__, "Metadata already exists in metadata collection. Item not added. Name: %s",
+                metadataItem->name);
+        return false;
+    } else {
+
+        // Duplicate key not found. Add new metadata item to metadata collection's hash
+        if (!psHashAdd(mdTable, key, metadataItem)) {
+            psError(__func__, "Couldn't add metadata item to metadata collection table. Name: %s",
+                    metadataItem->name);
             return false;
-        } else {
-
-            // Duplicate key not found. Add new metadata item to metadata collection's hash
-            if(!psHashAdd( mdTable, key, metadataItem )) {
-                psError( __func__, "Couldn't add metadata item to metadata collection table. Name: %s",
-                         metadataItem->name );
-                return false;
-            }
-        }
+        }
+    }
 
     // Add all items to metadata collection's list, even if they have the same metadata item names
-    if(!psListAdd( md->list, metadataItem, where )) {
-        psError( __func__, "Couldn't add metadata item to metadata collection list. Name: %s",
-                 metadataItem->name );
+    if (!psListAdd(md->list, metadataItem, where)) {
+        psError(__func__, "Couldn't add metadata item to metadata collection list. Name: %s",
+                metadataItem->name);
         return false;
     }
@@ -308,28 +316,28 @@
 }
 
-bool psMetadataAdd( psMetadata *restrict md, int where, const char *name, psMetadataType type,
-                    const char *comment, ... )
+bool psMetadataAdd(psMetadata * restrict md, int where, const char *name, psMetadataType type,
+                   const char *comment, ...)
 {
     va_list argPtr;
     psMetadataItem *metadataItem = NULL;
 
-    va_start( argPtr, comment );
-    metadataItem = psMetadataItemAllocV( name, type, comment, argPtr );
-    va_end( argPtr );
-
-    if(!psMetadataAddItem( md, where, metadataItem )) {
-        psError( __func__, "Couldn't add metadata item to metadata collection list. Name: %s",
-                 metadataItem->name );
-        psFree( metadataItem );
-        return false;
-    }
-
-    // Decrement reference count, since the metadata item is now in metadata collection and no longer needed here
-    psMemDecrRefCounter( metadataItem );
+    va_start(argPtr, comment);
+    metadataItem = psMetadataItemAllocV(name, type, comment, argPtr);
+    va_end(argPtr);
+
+    if (!psMetadataAddItem(md, where, metadataItem)) {
+        psError(__func__, "Couldn't add metadata item to metadata collection list. Name: %s",
+                metadataItem->name);
+        psFree(metadataItem);
+        return false;
+    }
+    // Decrement reference count, since the metadata item is now in metadata collection and no longer needed
+    // here
+    psMemDecrRefCounter(metadataItem);
 
     return true;
 }
 
-bool psMetadataRemove( psMetadata *restrict md, int where, const char *restrict key )
+bool psMetadataRemove(psMetadata * restrict md, int where, const char *restrict key)
 {
     int numChildren = 0;
@@ -340,49 +348,46 @@
 
     mdList = md->list;
-    if(mdList == NULL) {
-        psError( __func__, "Null metadata list not allowed" );
+    if (mdList == NULL) {
+        psError(__func__, "Null metadata list not allowed");
         return false;
     }
 
     mdTable = md->table;
-    if(mdTable == NULL) {
-        psError( __func__, "Null metadata table not allowed" );
-        return false;
-    }
-
+    if (mdTable == NULL) {
+        psError(__func__, "Null metadata table not allowed");
+        return false;
+    }
     // Select removal by key or index
-    if(key != NULL) {
+    if (key != NULL) {
 
         // Remove by key name
-        entry = ( psMetadataItem* ) psHashLookup( mdTable, key );
-        if(entry == NULL) {
-            psError( __func__, "Couldn't find metadata item remove. Name: %s", key );
+        entry = (psMetadataItem *) psHashLookup(mdTable, key);
+        if (entry == NULL) {
+            psError(__func__, "Couldn't find metadata item remove. Name: %s", key);
             return false;
         }
 
         numChildren = entry->items->size;
-        if(entry->type == PS_META_ITEM_SET && numChildren > 0) {
+        if (entry->type == PS_META_ITEM_SET && numChildren > 0) {
 
             // Table entry has children. Entry and children must be removed from metadata collection's list
-            psListSetIterator( mdList, PS_LIST_HEAD );
-            entryChild = psListGetCurrent( mdList );
-            while(entryChild != NULL) {
-                if(!psListRemove( entry->items, entryChild, PS_LIST_UNKNOWN )) {
-                    psError( __func__, "Couldn't remove metadata item from list. Name: %s", key );
+            psListSetIterator(mdList, PS_LIST_HEAD);
+            entryChild = psListGetCurrent(mdList);
+            while (entryChild != NULL) {
+                if (!psListRemove(entry->items, entryChild, PS_LIST_UNKNOWN)) {
+                    psError(__func__, "Couldn't remove metadata item from list. Name: %s", key);
                     return false;
                 }
-                entryChild = psListGetNext( entry->items );
+                entryChild = psListGetNext(entry->items);
             }
         }
-
         // Remove entry from metadata collection's list
-        if(!psListRemove( mdList, entry, PS_LIST_UNKNOWN )) {
-            psError( __func__, "Couldn't remove metadata item from list. Name: %s", key );
+        if (!psListRemove(mdList, entry, PS_LIST_UNKNOWN)) {
+            psError(__func__, "Couldn't remove metadata item from list. Name: %s", key);
             return false;
         }
-
         // Remove entry from metadata collection's table
-        if(!psHashRemove( mdTable, key )) {
-            psError( __func__, "Couldn't remove metadata item from table. Name: %s", key );
+        if (!psHashRemove(mdTable, key)) {
+            psError(__func__, "Couldn't remove metadata item from table. Name: %s", key);
             return false;
         }
@@ -390,18 +395,17 @@
 
         // Remove by index
-        entry = psListGet( mdList, where );
-        if(entry == NULL) {
-            psError( __func__, "Couldn't find metadata item from list. Index: %d", where );
+        entry = psListGet(mdList, where);
+        if (entry == NULL) {
+            psError(__func__, "Couldn't find metadata item from list. Index: %d", where);
             return false;
         }
 
         key = entry->name;
-        if(key == NULL) {
-            psError( __func__, "Null key name not allowed. Index: %d", where );
+        if (key == NULL) {
+            psError(__func__, "Null key name not allowed. Index: %d", where);
             return false;
         }
-
         // Use recursive remove, now that key is known
-        psMetadataRemove( md, PS_LIST_UNKNOWN, key );
+        psMetadataRemove(md, PS_LIST_UNKNOWN, key);
     }
 
@@ -409,23 +413,23 @@
 }
 
-psMetadataItem *psMetadataLookup( psMetadata *restrict md, const char *restrict key )
-{
-    psHash * mdTable = NULL;
+psMetadataItem *psMetadataLookup(psMetadata * restrict md, const char *restrict key)
+{
+    psHash *mdTable = NULL;
     psMetadataItem *entry = NULL;
 
     mdTable = md->table;
-    if(mdTable == NULL) {
-        psError( __func__, "Null metadata table not allowed" );
-        return NULL;
-    }
-
-    if(key == NULL) {
-        psError( __func__, "Null key name not allowed" );
-        return NULL;
-    }
-
-    entry = ( psMetadataItem* ) psHashLookup( mdTable, key );
-    if(entry == NULL) {
-        psError( __func__, "Could not find metadata item with given key. Key: %s", key );
+    if (mdTable == NULL) {
+        psError(__func__, "Null metadata table not allowed");
+        return NULL;
+    }
+
+    if (key == NULL) {
+        psError(__func__, "Null key name not allowed");
+        return NULL;
+    }
+
+    entry = (psMetadataItem *) psHashLookup(mdTable, key);
+    if (entry == NULL) {
+        psError(__func__, "Could not find metadata item with given key. Key: %s", key);
         return NULL;
     }
@@ -434,18 +438,18 @@
 }
 
-psMetadataItem *psMetadataGet( psMetadata *restrict md, int where )
-{
-    psList * mdList = NULL;
+psMetadataItem *psMetadataGet(psMetadata * restrict md, int where)
+{
+    psList *mdList = NULL;
     psMetadataItem *entry = NULL;
 
     mdList = md->list;
-    if(mdList == NULL) {
-        psError( __func__, "Null metadata list not allowed" );
-        return NULL;
-    }
-
-    entry = ( psMetadataItem* ) psListGet( mdList, where );
-    if(entry == NULL) {
-        psError( __func__, "Couldn't find metadata item with given index. Index: %d", where );
+    if (mdList == NULL) {
+        psError(__func__, "Null metadata list not allowed");
+        return NULL;
+    }
+
+    entry = (psMetadataItem *) psListGet(mdList, where);
+    if (entry == NULL) {
+        psError(__func__, "Couldn't find metadata item with given index. Index: %d", where);
         return NULL;
     }
@@ -454,50 +458,50 @@
 }
 
-bool psMetadataSetIterator( psMetadata *restrict md, int where )
-{
-    psList * mdList = NULL;
-
-    mdList = md->list;
-    if(mdList == NULL) {
-        psError( __func__, "Null metadata list not allowed" );
-        return false;
-    }
-
-    psListSetIterator( mdList, where );
+bool psMetadataSetIterator(psMetadata * restrict md, int where)
+{
+    psList *mdList = NULL;
+
+    mdList = md->list;
+    if (mdList == NULL) {
+        psError(__func__, "Null metadata list not allowed");
+        return false;
+    }
+
+    psListSetIterator(mdList, where);
 
     return true;
 }
 
-psMetadataItem *psMetadataGetNext( psMetadata *restrict md, const char *restrict match, int which )
-{
-    psList * mdList = NULL;
+psMetadataItem *psMetadataGetNext(psMetadata * restrict md, const char *restrict match, int which)
+{
+    psList *mdList = NULL;
     psMetadataItem *entry = NULL;
 
     mdList = md->list;
-    if(mdList == NULL) {
-        psError( __func__, "Null metadata list not allowed" );
-        return NULL;
-    }
-
-    mdList = md->list;
-    if(mdList == NULL) {
-        psError( __func__, "Null metadata list not allowed" );
-        return NULL;
-    }
-
-    psListSetIterator( mdList, which );
-    entry = psListGetCurrent( mdList );
-    while(entry != NULL) {
-        if(!strncmp( match, entry->name, strlen( match ) )) {
+    if (mdList == NULL) {
+        psError(__func__, "Null metadata list not allowed");
+        return NULL;
+    }
+
+    mdList = md->list;
+    if (mdList == NULL) {
+        psError(__func__, "Null metadata list not allowed");
+        return NULL;
+    }
+
+    psListSetIterator(mdList, which);
+    entry = psListGetCurrent(mdList);
+    while (entry != NULL) {
+        if (!strncmp(match, entry->name, strlen(match))) {
 
             // Match found
             return entry;
         }
-        entry = psListGetNext( mdList );
+        entry = psListGetNext(mdList);
     }
 
     // Match not found
-    if(entry == NULL) {
-        psError( __func__, "Couldn't find metadata item with given match. Match: %s", match );
+    if (entry == NULL) {
+        psError(__func__, "Couldn't find metadata item with given match. Match: %s", match);
     }
 
@@ -505,35 +509,35 @@
 }
 
-psMetadataItem *psMetadataGetPrevious( psMetadata *restrict md, const char *restrict match, int which )
-{
-    psList * mdList = NULL;
+psMetadataItem *psMetadataGetPrevious(psMetadata * restrict md, const char *restrict match, int which)
+{
+    psList *mdList = NULL;
     psMetadataItem *entry = NULL;
 
     mdList = md->list;
-    if(mdList == NULL) {
-        psError( __func__, "Null metadata list not allowed" );
-        return NULL;
-    }
-
-    mdList = md->list;
-    if(mdList == NULL) {
-        psError( __func__, "Null metadata list not allowed" );
-        return NULL;
-    }
-
-    psListSetIterator( mdList, which );
-    entry = psListGetCurrent( mdList );
-    while(entry != NULL) {
-        if(!strncmp( match, entry->name, strlen( match ) )) {
+    if (mdList == NULL) {
+        psError(__func__, "Null metadata list not allowed");
+        return NULL;
+    }
+
+    mdList = md->list;
+    if (mdList == NULL) {
+        psError(__func__, "Null metadata list not allowed");
+        return NULL;
+    }
+
+    psListSetIterator(mdList, which);
+    entry = psListGetCurrent(mdList);
+    while (entry != NULL) {
+        if (!strncmp(match, entry->name, strlen(match))) {
 
             // Match found
             return entry;
         }
-        entry = psListGetPrevious( mdList );
+        entry = psListGetPrevious(mdList);
     }
 
     // Match not found
-    if(entry == NULL) {
-        psError( __func__, "Couldn't find metadata item with given match. Match: %s", match );
+    if (entry == NULL) {
+        psError(__func__, "Couldn't find metadata item with given match. Match: %s", match);
     }
 
@@ -541,40 +545,40 @@
 }
 
-void psMetadataItemPrint( FILE *fd, const char *format, const psMetadataItem *restrict metadataItem )
+void psMetadataItemPrint(FILE * fd, const char *format, const psMetadataItem * restrict metadataItem)
 {
     psMetadataType type;
 
-    if(fd == NULL) {
-        psError( __func__, "Null file descriptor not allowed" );
-        return ;
-    }
-
-    if(format == NULL) {
-        psError( __func__, "Null format not allowed" );
-        return ;
-    }
-
-    if(metadataItem == NULL) {
-        psError( __func__, "Null metadata not allowed" );
-        return ;
+    if (fd == NULL) {
+        psError(__func__, "Null file descriptor not allowed");
+        return;
+    }
+
+    if (format == NULL) {
+        psError(__func__, "Null format not allowed");
+        return;
+    }
+
+    if (metadataItem == NULL) {
+        psError(__func__, "Null metadata not allowed");
+        return;
     }
 
     type = metadataItem->type;
 
-    switch(type) {
+    switch (type) {
     case PS_META_BOOL:
-        fprintf( fd, format, metadataItem->data.B );
+        fprintf(fd, format, metadataItem->data.B);
         break;
     case PS_META_S32:
-        fprintf( fd, format, metadataItem->data.S32 );
+        fprintf(fd, format, metadataItem->data.S32);
         break;
     case PS_META_F32:
-        fprintf( fd, format, metadataItem->data.F32 );
+        fprintf(fd, format, metadataItem->data.F32);
         break;
     case PS_META_F64:
-        fprintf( fd, format, metadataItem->data.F64 );
+        fprintf(fd, format, metadataItem->data.F64);
         break;
     case PS_META_STR:
-        fprintf( fd, format, metadataItem->data.V );
+        fprintf(fd, format, metadataItem->data.V);
         break;
     case PS_META_ITEM_SET:
@@ -585,17 +589,17 @@
     case PS_META_UNKNOWN:
     default:
-        psError( __func__, " Invalid psMetadataType to print: %d", type );
-    }
-}
-
-psMetadata *psMetadataFReadHeader( psMetadata *output, char *extName, int extNum, fitsfile *fd )
+        psError(__func__, " Invalid psMetadataType to print: %d", type);
+    }
+}
+
+psMetadata *psMetadataFReadHeader(psMetadata * output, char *extName, int extNum, fitsfile * fd)
 {
     bool tempBool;
     bool success;
     char keyType;
-    char keyName[ FITS_LINE_SIZE ];
-    char keyValue[ FITS_LINE_SIZE ];
-    char keyComment[ FITS_LINE_SIZE ];
-    char fitsErr[ MAX_STRING_LENGTH ];
+    char keyName[FITS_LINE_SIZE];
+    char keyValue[FITS_LINE_SIZE];
+    char keyComment[FITS_LINE_SIZE];
+    char fitsErr[MAX_STRING_LENGTH];
     int i;
     int hduType = 0;
@@ -605,30 +609,27 @@
     psMetadataType metadataItemType;
 
-    if(fd == NULL) {
-        psError( __func__, "Null FITS file descriptor not allowed" );
-        return NULL;
-    }
-
-    if(extName == NULL && extNum == 0) {
-        psError( __func__, "Null extName and extNum = 0 not allowed" );
-        return NULL;
-    } else
-        if(extName && extNum) {
-            psError( __func__, "Both extName and extNum arguments should not have non zero values." );
-            return NULL;
-        }
-
+    if (fd == NULL) {
+        psError(__func__, "Null FITS file descriptor not allowed");
+        return NULL;
+    }
+
+    if (extName == NULL && extNum == 0) {
+        psError(__func__, "Null extName and extNum = 0 not allowed");
+        return NULL;
+    } else if (extName && extNum) {
+        psError(__func__, "Both extName and extNum arguments should not have non zero values.");
+        return NULL;
+    }
     // Allocate metadata if user didn't
-    if(output == NULL) {
+    if (output == NULL) {
         output = psMetadataAlloc();
     }
-
     // Move to user designated HDU number or HDU name in FITS file. HDU numbers starts at one.
-    if(extName != NULL) {
-        if(fits_movnam_hdu( fd, ANY_HDU, extName, 0, &status ) != 0) {
+    if (extName != NULL) {
+        if (fits_movnam_hdu(fd, ANY_HDU, extName, 0, &status) != 0) {
             FITS_ERROR("FITS error while locating header %s: %s", extName);
         }
     } else {
-        if(fits_movabs_hdu( fd, extNum, &hduType, &status ) != 0) {
+        if (fits_movabs_hdu(fd, extNum, &hduType, &status) != 0) {
             FITS_ERROR("FITS error while locating header %d: %s", extNum);
         }
@@ -636,19 +637,19 @@
 
     // Get number of key names
-    if(fits_get_hdrpos( fd, &numKeys, &keyNum, &status ) != 0) {
+    if (fits_get_hdrpos(fd, &numKeys, &keyNum, &status) != 0) {
         FITS_ERROR("FITS error while reading key %d: %s", keyNum);
     }
-
     // Get each key name. Keywords start at one.
-    for(i = 1; i <= numKeys; i++) {
-        if(fits_read_keyn( fd, i, keyName, keyValue, keyComment, &status ) != 0) {
+    for (i = 1; i <= numKeys; i++) {
+        if (fits_read_keyn(fd, i, keyName, keyValue, keyComment, &status) != 0) {
             FITS_ERROR("FITS error while reading key %d: %s", keyNum);
         }
-        if(fits_get_keytype( keyValue, &keyType, &status ) != 0) {
-            fits_get_errstatus( status, fitsErr );
-            if(status != VALUE_UNDEFINED) {
+        if (fits_get_keytype(keyValue, &keyType, &status) != 0) {
+            fits_get_errstatus(status, fitsErr);
+            if (status != VALUE_UNDEFINED) {
                 FITS_ERROR("FITS error while determining key %d type: %s", keyNum);
             } else {
-                // Some keywords are still valid even though they don't have a type, like COMMENTS and HISTORY
+                // Some keywords are still valid even though they don't have a type, like COMMENTS and
+                // HISTORY
                 keyType = 'C';
                 status = 0;
@@ -656,31 +657,37 @@
         }
 
-        switch(keyType) {
+        switch (keyType) {
         case 'I':
             metadataItemType = PS_META_S32;
-            success = psMetadataAdd( output, PS_LIST_TAIL, keyName, metadataItemType, keyComment, atoi( keyValue ) );
+            success =
+                psMetadataAdd(output, PS_LIST_TAIL, keyName, metadataItemType, keyComment,
+                              atoi(keyValue));
             break;
         case 'F':
             metadataItemType = PS_META_F64;
-            success = psMetadataAdd( output, PS_LIST_TAIL, keyName, metadataItemType, keyComment, atof( keyValue ) );
+            success =
+                psMetadataAdd(output, PS_LIST_TAIL, keyName, metadataItemType, keyComment,
+                              atof(keyValue));
             break;
         case 'C':
             metadataItemType = PS_META_STR;
-            success = psMetadataAdd( output, PS_LIST_TAIL, keyName, metadataItemType, keyComment, keyValue );
+            success =
+                psMetadataAdd(output, PS_LIST_TAIL, keyName, metadataItemType, keyComment, keyValue);
             break;
         case 'L':
             metadataItemType = PS_META_BOOL;
-            tempBool = ( keyValue[ 0 ] == 'T' ) ? 1 : 0;
-            success = psMetadataAdd( output, PS_LIST_TAIL, keyName, metadataItemType, keyComment, tempBool );
+            tempBool = (keyValue[0] == 'T') ? 1 : 0;
+            success =
+                psMetadataAdd(output, PS_LIST_TAIL, keyName, metadataItemType, keyComment, tempBool);
             break;
         case 'U':
         case 'X':
         default:
-            psError( __func__, "Invalid psMetadataType: %c", keyType );
+            psError(__func__, "Invalid psMetadataType: %c", keyType);
             return output;
         }
 
-        if(!success) {
-            psError( __func__, "Failed to add metadata item. Name: %s", keyName );
+        if (!success) {
+            psError(__func__, "Failed to add metadata item. Name: %s", keyName);
             return output;
         }
Index: trunk/psLib/src/collections/psMetadata.h
===================================================================
--- trunk/psLib/src/collections/psMetadata.h	(revision 1406)
+++ trunk/psLib/src/collections/psMetadata.h	(revision 1407)
@@ -1,2 +1,3 @@
+
 /** @file  psMetadata.h
 *
@@ -10,18 +11,18 @@
 *  @author Ross Harman, MHPCC
 *
-*  @version $Revision: 1.15 $ $Name: not supported by cvs2svn $
-*  @date $Date: 2004-08-05 20:55:22 $
+*  @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
 */
 #ifndef PS_METADATA_H
-#define PS_METADATA_H
-
-#include <stdarg.h>
-#include <stdio.h>
-#include <fitsio.h>
-
-#include "psHash.h"
-#include "psList.h"
+#    define PS_METADATA_H
+
+#    include <stdarg.h>
+#    include <stdio.h>
+#    include <fitsio.h>
+
+#    include "psHash.h"
+#    include "psList.h"
 
 /// @addtogroup Metadata
@@ -33,16 +34,16 @@
  */
 typedef enum {
-    PS_META_ITEM_SET = 0,                   ///< Null. Metadata is in psMetadataItem.items
-    PS_META_BOOL,                           ///< Boolean data.
-    PS_META_S32,                            ///< Signed 32-bit integer data.
-    PS_META_F32,                            ///< Single-precision float data.
-    PS_META_F64,                            ///< Double-precision float data.
-    PS_META_STR,                            ///< String data (Stored in as void *).
-    PS_META_IMG,                            ///< Image data (Stored in as void *).
-    PS_META_JPEG,                           ///< JPEG data (Stored in as void .
-    PS_META_PNG,                            ///< PNG data (Stored in as void *).
-    PS_META_ASTROM,                         ///< Astrometric coefficients (Stored in as void *).
-    PS_META_UNKNOWN,                        ///< Other data (Stored in as void *).
-    PS_META_NTYPE                         ///< Number of types. Must be last.
+    PS_META_ITEM_SET = 0,       // /< Null. Metadata is in psMetadataItem.items
+    PS_META_BOOL,                          // /< Boolean data.
+    PS_META_S32,                           // /< Signed 32-bit integer data.
+    PS_META_F32,                           // /< Single-precision float data.
+    PS_META_F64,                           // /< Double-precision float data.
+    PS_META_STR,                           // /< String data (Stored in as void *).
+    PS_META_IMG,                           // /< Image data (Stored in as void *).
+    PS_META_JPEG,                          // /< JPEG data (Stored in as void .
+    PS_META_PNG,                           // /< PNG data (Stored in as void *).
+    PS_META_ASTROM,                        // /< Astrometric coefficients (Stored in as void *).
+    PS_META_UNKNOWN,                       // /< Other data (Stored in as void *).
+    PS_META_NTYPE                          // /< Number of types. Must be last.
 } psMetadataType;
 
@@ -54,17 +55,16 @@
 typedef struct psMetadataItem
 {
-    const int id;                       ///< Unique ID for metadata item.
-    char *restrict name;                ///< Name of metadata item.
-    psMetadataType type;                ///< Type of metadata item.
-    union
-    {
+    const int id;               // /< Unique ID for metadata item.
+    char *restrict name;        // /< Name of metadata item.
+    psMetadataType type;        // /< Type of metadata item.
+    union {
         bool B;
-        psS32 S32;                  ///< Signed 32-bit integer data.
-        psF32 F32;                  ///< Single-precision float data.
-        psF64 F64;                  ///< Double-precision float data.
-        psPTR V;                    ///< Pointer to other type of data.
-    }data;                          ///< Union for data types.
-    char *comment;                      ///< Optional comment ("", not NULL).
-    psList *restrict items;             ///< List of psMetadataItems with same name.
+        psS32 S32;              // /< Signed 32-bit integer data.
+        psF32 F32;              // /< Single-precision float data.
+        psF64 F64;              // /< Double-precision float data.
+        psPTR V;                // /< Pointer to other type of data.
+    } data;                     // /< Union for data types.
+    char *comment;              // /< Optional comment ("", not NULL).
+    psList *restrict items;     // /< List of psMetadataItems with same name.
 }
 psMetadataItem;
@@ -78,12 +78,13 @@
 typedef struct psMetadata
 {
-    psList* restrict list;
-    psHash* restrict table;
+    psList *restrict list;
+    psHash *restrict table;
 }
 psMetadata;
 
-
 /*****************************************************************************/
+
 /* FUNCTION PROTOTYPES                                                       */
+
 /*****************************************************************************/
 
@@ -101,10 +102,9 @@
  * @return psMetadataItem*: Pointer metadata item.
  */
-psMetadataItem *psMetadataItemAlloc(
-    const char *name,                       ///< Name of metadata item.
-    psMetadataType type,                    ///< Type of metadata item.
-    const char *comment,                    ///< Comment for metadata item.
-    ...                                 ///< Arguments for name formatting and metadata item data.
-);
+psMetadataItem *psMetadataItemAlloc(const char *name,   // /< Name of metadata item.
+                                    psMetadataType type,        // /< Type of metadata item.
+                                    const char *comment,        // /< Comment for metadata item.
+                                    ... // /< Arguments for name formatting and metadata item data.
+                                   );
 
 /** Create a metadata item with va_list.
@@ -121,10 +121,10 @@
  * @return psMetadataItem*: Pointer metadata item.
  */
-psMetadataItem *psMetadataItemAllocV(
-    const char *name,                       ///< Name of metadata item.
-    psMetadataType type,                    ///< Type of metadata item.
-    const char *comment,                    ///< Comment for metadata item.
-    va_list list                        ///< Arguments for name formatting and metadata item data.
-);
+psMetadataItem *psMetadataItemAllocV(const char *name,  // /< Name of metadata item.
+                                     psMetadataType type,       // /< Type of metadata item.
+                                     const char *comment,       // /< Comment for metadata item.
+                                     va_list list       // /< Arguments for name formatting and metadata item
+                                     // data.
+                                    );
 
 /** Create a metadata collection.
@@ -134,7 +134,6 @@
  * @return psMetadata*: Pointer metadata.
  */
-psMetadata *psMetadataAlloc(
-    void                                ///< Void.
-);
+psMetadata *psMetadataAlloc(void        // /< Void.
+                           );
 
 /** Add existing metadata item to metadata collection.
@@ -144,9 +143,8 @@
  * @return bool: True for success, false for failure.
  */
-bool psMetadataAddItem(
-    psMetadata *restrict md,                ///< Metadata collection to insert metadat item.
-    int where,                              ///< Location to be added.
-    psMetadataItem *restrict item       ///< Metadata item to be added.
-);
+bool psMetadataAddItem(psMetadata * restrict md,        // /< Metadata collection to insert metadat item.
+                       int where,       // /< Location to be added.
+                       psMetadataItem * restrict item   // /< Metadata item to be added.
+                      );
 
 /** Create and add a metadata item to metadata collection.
@@ -156,12 +154,11 @@
  * @return bool: True for success, false for failure.
  */
-bool psMetadataAdd(
-    psMetadata *restrict md,                ///< Metadata collection to insert metadat item.
-    int where,                              ///< Location to be added.
-    const char *name,                       ///< Name of metadata item.
-    psMetadataType type,                    ///< Type of metadata item.
-    const char *comment,                    ///< Comment for metadata item.
-    ...                                 ///< Arguments for name formatting and metadata item data.
-);
+bool psMetadataAdd(psMetadata * restrict md,    // /< Metadata collection to insert metadat item.
+                   int where,   // /< Location to be added.
+                   const char *name,    // /< Name of metadata item.
+                   psMetadataType type, // /< Type of metadata item.
+                   const char *comment, // /< Comment for metadata item.
+                   ...          // /< Arguments for name formatting and metadata item data.
+                  );
 
 /** Remove an item from metadata collection.
@@ -174,9 +171,8 @@
  * @return bool: True for success, false for failure.
  */
-bool psMetadataRemove(
-    psMetadata *restrict md,                ///< Metadata collection to insert metadat item.
-    int where,                              ///< Location to be removed.
-    const char *restrict key            ///< Name of metadata key.
-);
+bool psMetadataRemove(psMetadata * restrict md, // /< Metadata collection to insert metadat item.
+                      int where,        // /< Location to be removed.
+                      const char *restrict key  // /< Name of metadata key.
+                     );
 
 /** Find an item in the metadata collection based on key name.
@@ -187,8 +183,8 @@
  * @return psMetadataItem*: Pointer metadata item.
  */
-psMetadataItem *psMetadataLookup(
-    psMetadata *restrict md,                ///< Metadata collection to insert metadat item.
-    const char *restrict key            ///< Name of metadata key.
-);
+psMetadataItem *psMetadataLookup(psMetadata * restrict md,      // /< Metadata collection to insert metadat
+                                 // item.
+                                 const char *restrict key       // /< Name of metadata key.
+                                );
 
 /** Find an item in the metadata collection based on list index.
@@ -198,8 +194,7 @@
  * @return psMetadataItem*: Pointer metadata item.
  */
-psMetadataItem *psMetadataGet(
-    psMetadata *restrict md,                ///< Metadata collection to insert metadat item.
-    int where                           ///< Location to be retrieved.
-);
+psMetadataItem *psMetadataGet(psMetadata * restrict md, // /< Metadata collection to insert metadat item.
+                              int where // /< Location to be retrieved.
+                             );
 
 /** Set or reset metadata iterator.
@@ -209,8 +204,7 @@
  * @return void: void.
  */
-bool psMetadataSetIterator(
-    psMetadata *restrict md,                ///< Metadata collection to iterate.
-    int where                           ///< Location of iterator.
-);
+bool psMetadataSetIterator(psMetadata * restrict md,    // /< Metadata collection to iterate.
+                           int where    // /< Location of iterator.
+                          );
 
 /** Get next metadata item.
@@ -220,9 +214,8 @@
  * @return psMetadataItem*: Pointer metadata item.
  */
-psMetadataItem *psMetadataGetNext(
-    psMetadata *restrict md,                ///< Metadata collection to iterate.
-    const char *restrict match,             ///< Beginning of key name.
-    int which                           ///< Iterator to be used.
-);
+psMetadataItem *psMetadataGetNext(psMetadata * restrict md,     // /< Metadata collection to iterate.
+                                  const char *restrict match,   // /< Beginning of key name.
+                                  int which     // /< Iterator to be used.
+                                 );
 
 /** Get previous metadata item.
@@ -232,9 +225,8 @@
  * @return psMetadataItem*: Pointer metadata item.
  */
-psMetadataItem *psMetadataGetPrevious(
-    psMetadata *restrict md,                ///< Metadata collection to iterate.
-    const char *restrict match,             ///< Beginning of key name.
-    int which                           ///< Iterator to be used.
-);
+psMetadataItem *psMetadataGetPrevious(psMetadata * restrict md, // /< Metadata collection to iterate.
+                                      const char *restrict match,       // /< Beginning of key name.
+                                      int which // /< Iterator to be used.
+                                     );
 
 /** Print metadata item to file.
@@ -248,9 +240,8 @@
  * @return psMetadataItem*: Pointer metadata item.
  */
-void psMetadataItemPrint(
-    FILE *fd,                                       ///< Pointer to file to write metadata item.
-    const char *format,                             ///< Format to print metadata item.
-    const psMetadataItem *restrict metadataItem     ///< Metadata item to print.
-);
+void psMetadataItemPrint(FILE * fd,     // /< Pointer to file to write metadata item.
+                         const char *format,    // /< Format to print metadata item.
+                         const psMetadataItem * restrict metadataItem   // /< Metadata item to print.
+                        );
 
 /** Read metadata header.
@@ -261,10 +252,9 @@
  * @return psMetadata*: Pointer metadata.
  */
-psMetadata *psMetadataReadHeader(
-    psMetadata *output,                     ///< Resulting metadata from read.
-    char *extname,                          ///< File name extension string.
-    int extnum,                             ///< File name extension number. Starts at 1.
-    char *filename                          ///< Name of file to read.
-);
+psMetadata *psMetadataReadHeader(psMetadata * output,   // /< Resulting metadata from read.
+                                 char *extname, // /< File name extension string.
+                                 int extnum,    // /< File name extension number. Starts at 1.
+                                 char *filename // /< Name of file to read.
+                                );
 
 /** Read metadata header.
@@ -274,10 +264,10 @@
  * @return psMetadata*: Pointer metadata.
  */
-psMetadata *psMetadataFReadHeader(
-    psMetadata *output,                     ///< Resulting metadata from read.
-    char *extName,                          ///< File name extension string.
-    int extNum,                             ///< File name extension number.
-    fitsfile *fd                            ///< Pointer to file to read.
-);
+psMetadata *psMetadataFReadHeader(psMetadata * output,  // /< Resulting metadata from read.
+                                  char *extName,        // /< File name extension string.
+                                  int extNum,   // /< File name extension number.
+                                  fitsfile * fd // /< Pointer to file to read.
+                                 );
+
 /// @}
 
Index: trunk/psLib/src/collections/psScalar.c
===================================================================
--- trunk/psLib/src/collections/psScalar.c	(revision 1406)
+++ trunk/psLib/src/collections/psScalar.c	(revision 1407)
@@ -1,2 +1,3 @@
+
 /** @file  psScalar.c
  *
@@ -8,6 +9,6 @@
  *  @author Ross Harman, MHPCC
  *
- *  @version $Revision: 1.5 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2004-08-06 22:34:05 $
+ *  @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
@@ -15,5 +16,7 @@
 
 /******************************************************************************/
+
 /*  INCLUDE FILES                                                             */
+
 /******************************************************************************/
 #include "psMemory.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,5 +67,7 @@
 
 /*****************************************************************************/
+
 /* FUNCTION IMPLEMENTATION - PUBLIC                                          */
+
 /*****************************************************************************/
 psScalar *psScalarAlloc(psC64 value, psElemType dataType)
@@ -61,7 +76,7 @@
 
     // Create scalar
-    scalar = (psScalar *)psAlloc(sizeof(psScalar));
-    if(scalar == NULL) {
-        psAbort(__func__," : Line %d - Failed to allocate memory", __LINE__);
+    scalar = (psScalar *) psAlloc(sizeof(psScalar));
+    if (scalar == NULL) {
+        psAbort(__func__, " : Line %d - Failed to allocate memory", __LINE__);
     }
 
@@ -71,38 +86,38 @@
     switch (dataType) {
     case PS_TYPE_S8:
-        scalar->data.S8 = (psS8)value;
+        scalar->data.S8 = (psS8) value;
         break;
     case PS_TYPE_U8:
-        scalar->data.U8 = (psU8)value;
+        scalar->data.U8 = (psU8) value;
         break;
     case PS_TYPE_S16:
-        scalar->data.S16 = (psS16)value;
+        scalar->data.S16 = (psS16) value;
         break;
     case PS_TYPE_U16:
-        scalar->data.U16 = (psU16)value;
+        scalar->data.U16 = (psU16) value;
         break;
     case PS_TYPE_S32:
-        scalar->data.S32 = (psS32)value;
+        scalar->data.S32 = (psS32) value;
         break;
     case PS_TYPE_U32:
-        scalar->data.U32 = (psU32)value;
+        scalar->data.U32 = (psU32) value;
         break;
     case PS_TYPE_S64:
-        scalar->data.S64 = (psS64)value;
+        scalar->data.S64 = (psS64) value;
         break;
     case PS_TYPE_U64:
-        scalar->data.U64 = (psU64)value;
+        scalar->data.U64 = (psU64) value;
         break;
     case PS_TYPE_F32:
-        scalar->data.F32 = (psF32)value;
+        scalar->data.F32 = (psF32) value;
         break;
     case PS_TYPE_F64:
-        scalar->data.F64 = (psF64)value;
+        scalar->data.F64 = (psF64) value;
         break;
     case PS_TYPE_C32:
-        scalar->data.C32 = (psC32)value;
+        scalar->data.C32 = (psC32) value;
         break;
     case PS_TYPE_C64:
-        scalar->data.C64 = (psC64)value;
+        scalar->data.C64 = (psC64) value;
         break;
     default:
@@ -110,9 +125,8 @@
     }
 
-
     return scalar;
 }
 
-void psScalarFree(psScalar *restrict scalar)
+void psScalarFree(psScalar * restrict scalar)
 {
     if (scalar == NULL) {
@@ -122,4 +136,2 @@
     psFree(scalar);
 }
-
-
Index: trunk/psLib/src/collections/psScalar.h
===================================================================
--- trunk/psLib/src/collections/psScalar.h	(revision 1406)
+++ trunk/psLib/src/collections/psScalar.h	(revision 1407)
@@ -1,2 +1,3 @@
+
 /** @file  psScalar.h
  *
@@ -10,6 +11,6 @@
  *  @author Ross Harman, MHPCC
  *
- *  @version $Revision: 1.3 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2004-08-06 22:34:05 $
+ *  @version $Revision: 1.4 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2004-08-07 00:06:06 $
  *
  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -17,7 +18,7 @@
 
 #ifndef PS_SCALAR_H
-#define PS_SCALAR_H
+#    define PS_SCALAR_H
 
-#include "psType.h"
+#    include "psType.h"
 
 /// @addtogroup Scalar
@@ -31,25 +32,27 @@
 typedef struct
 {
-    psType type;                       ///< Type of data.
+    psType type;                // /< Type of data.
 
     union {
-        psU8    U8;                    ///< Unsigned 8-bit integer data.
-        psU16   U16;                   ///< Unsigned 16-bit integer data.
-        psU32   U32;                   ///< Unsigned 32-bit integer data.
-        psU64   U64;                   ///< Unsigned 64-bit integer data.
-        psS8    S8;                    ///< Signed 8-bit integer data.
-        psS16   S16;                   ///< Signed 16-bit integer data.
-        psS32   S32;                   ///< Signed 32-bit integer data.
-        psS64   S64;                   ///< Signed 64-bit integer data.
-        psF32   F32;                   ///< Single-precision float data.
-        psF64   F64;                   ///< Double-precision float data.
-        psC32   C32;                   ///< Single-precision complex data.
-        psC64   C64;                   ///< Double-precision complex data.
-    } data;                            ///< Union for data types.
+        psU8 U8;                // /< Unsigned 8-bit integer data.
+        psU16 U16;              // /< Unsigned 16-bit integer data.
+        psU32 U32;              // /< Unsigned 32-bit integer data.
+        psU64 U64;              // /< Unsigned 64-bit integer data.
+        psS8 S8;                // /< Signed 8-bit integer data.
+        psS16 S16;              // /< Signed 16-bit integer data.
+        psS32 S32;              // /< Signed 32-bit integer data.
+        psS64 S64;              // /< Signed 64-bit integer data.
+        psF32 F32;              // /< Single-precision float data.
+        psF64 F64;              // /< Double-precision float data.
+        psC32 C32;              // /< Single-precision complex data.
+        psC64 C64;              // /< Double-precision complex data.
+    } data;                     // /< Union for data types.
 }
 psScalar;
 
 /*****************************************************************************/
+
 /* FUNCTION PROTOTYPES                                                       */
+
 /*****************************************************************************/
 
@@ -62,9 +65,7 @@
  *
  */
-psScalar *psScalarAlloc(
-    psC64 value,            ///< Data to be put into psScalar.
-    psElemType dataType     ///< Type of data to be held by psScalar.
-);
-
+psScalar *psScalarAlloc(psC64 value,    // /< Data to be put into psScalar.
+                        psElemType dataType     // /< Type of data to be held by psScalar.
+                       );
 
 /** Deallocate a scalar.
@@ -75,7 +76,6 @@
  *
  */
-void psScalarFree(
-    psScalar *restrict scalar  ///< Scalar to free.
-);
+void psScalarFree(psScalar * restrict scalar    // /< Scalar to free.
+                 );
 
 /// @}
Index: trunk/psLib/src/collections/psVector.c
===================================================================
--- trunk/psLib/src/collections/psVector.c	(revision 1406)
+++ trunk/psLib/src/collections/psVector.c	(revision 1407)
@@ -1,2 +1,3 @@
+
 /** @file  psVector.c
 *
@@ -8,6 +9,6 @@
 *  @author Ross Harman, MHPCC
 *
-*  @version $Revision: 1.20 $ $Name: not supported by cvs2svn $
-*  @date $Date: 2004-08-06 22:34:05 $
+*  @version $Revision: 1.21 $ $Name: not supported by cvs2svn $
+*  @date $Date: 2004-08-07 00:06:06 $
 *
 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -15,7 +16,9 @@
 
 /******************************************************************************/
+
 /*  INCLUDE FILES                                                             */
-/******************************************************************************/
-#include <string.h>        // for memcpy
+
+/******************************************************************************/
+#include <string.h>                        // for memcpy
 #include <stdlib.h>
 #include <math.h>
@@ -28,5 +31,7 @@
 
 /******************************************************************************/
+
 /*  DEFINE STATEMENTS                                                         */
+
 /******************************************************************************/
 
@@ -34,5 +39,7 @@
 
 /******************************************************************************/
+
 /*  TYPE DEFINITIONS                                                          */
+
 /******************************************************************************/
 
@@ -40,5 +47,7 @@
 
 /*****************************************************************************/
+
 /*  GLOBAL VARIABLES                                                         */
+
 /*****************************************************************************/
 
@@ -46,5 +55,7 @@
 
 /*****************************************************************************/
+
 /*  FILE STATIC VARIABLES                                                    */
+
 /*****************************************************************************/
 
@@ -52,27 +63,31 @@
 
 /*****************************************************************************/
+
 /*  FUNCTION IMPLEMENTATION - LOCAL                                          */
-/*****************************************************************************/
-static void vectorFree( psVector *restrict psVec );
-
-/*****************************************************************************/
+
+/*****************************************************************************/
+static void vectorFree(psVector * restrict psVec);
+
+/*****************************************************************************/
+
 /* FUNCTION IMPLEMENTATION - PUBLIC                                          */
-/*****************************************************************************/
-psVector* psVectorAlloc( unsigned int nalloc, psElemType elemType )
-{
-    psVector * psVec = NULL;
+
+/*****************************************************************************/
+psVector *psVectorAlloc(unsigned int nalloc, psElemType elemType)
+{
+    psVector *psVec = NULL;
     int elementSize = 0;
 
     // Invalid nalloc
-    if ( nalloc < 1 ) {
-        psError( __func__, "Invalid value for nalloc. nalloc: %d\n", nalloc );
+    if (nalloc < 1) {
+        psError(__func__, "Invalid value for nalloc. nalloc: %d\n", nalloc);
         return NULL;
     }
 
-    elementSize = PSELEMTYPE_SIZEOF( elemType );
+    elementSize = PSELEMTYPE_SIZEOF(elemType);
 
     // Create vector struct
-    psVec = ( psVector * ) psAlloc( sizeof( psVector ) );
-    p_psMemSetDeallocator( psVec, ( psFreeFcn ) vectorFree );
+    psVec = (psVector *) psAlloc(sizeof(psVector));
+    p_psMemSetDeallocator(psVec, (psFreeFcn) vectorFree);
 
     psVec->type.dimen = PS_DIMEN_VECTOR;
@@ -82,10 +97,10 @@
 
     // Create vector data array
-    psVec->data.V = psAlloc( nalloc * elementSize );
+    psVec->data.V = psAlloc(nalloc * elementSize);
 
     return psVec;
 }
 
-psVector *psVectorRealloc( unsigned int nalloc, psVector *restrict in )
+psVector *psVectorRealloc(unsigned int nalloc, psVector * restrict in)
 {
     int elementSize = 0;
@@ -93,52 +108,48 @@
 
     // Invalid nalloc
-    if ( nalloc < 1 ) {
-        psError( __func__, "Invalid value for realloc (%d)\n", nalloc );
+    if (nalloc < 1) {
+        psError(__func__, "Invalid value for realloc (%d)\n", nalloc);
         return NULL;
     }
 
-    if ( in == NULL ) {
-        psError( __func__, "Null input vector\n" );
+    if (in == NULL) {
+        psError(__func__, "Null input vector\n");
         return NULL;
-    } else
-        if ( in->nalloc != nalloc ) {                    // No need to realloc to same size
-            elemType = in->type.type;
-            elementSize = PSELEMTYPE_SIZEOF( elemType );
-            if ( nalloc < in->n ) {
-                in->n = nalloc;
-            }
-
-            // Realloc after decrementation to avoid accessing freed array elements
-            in->data.V = psRealloc( in->data.V, nalloc * elementSize );
-            in->nalloc = nalloc;
+    } else if (in->nalloc != nalloc) {     // No need to realloc to same size
+        elemType = in->type.type;
+        elementSize = PSELEMTYPE_SIZEOF(elemType);
+        if (nalloc < in->n) {
+            in->n = nalloc;
         }
+        // Realloc after decrementation to avoid accessing freed array elements
+        in->data.V = psRealloc(in->data.V, nalloc * elementSize);
+        in->nalloc = nalloc;
+    }
 
     return in;
 }
 
-psVector *psVectorRecycle( psVector *restrict in, unsigned int nalloc, psElemType type )
+psVector *psVectorRecycle(psVector * restrict in, unsigned int nalloc, psElemType type)
 {
     psElemType elemType;
 
-    if ( in == NULL ) {
-        return psVectorAlloc( nalloc, type );
+    if (in == NULL) {
+        return psVectorAlloc(nalloc, type);
     }
 
     elemType = in->type.type;
 
-    if ( in->nalloc == nalloc && elemType == type ) {
+    if (in->nalloc == nalloc && elemType == type) {
         // it is proper size/type already
         return in;
     }
-
     // Invalid nalloc
-    if ( nalloc < 1 ) {
-        psError( __func__, "Invalid value for nalloc (%d)\n", nalloc );
-        psFree( in );
+    if (nalloc < 1) {
+        psError(__func__, "Invalid value for nalloc (%d)\n", nalloc);
+        psFree(in);
         return NULL;
     }
 
-
-    in->data.V = psRealloc( in->data.V, nalloc * PSELEMTYPE_SIZEOF( type ) );
+    in->data.V = psRealloc(in->data.V, nalloc * PSELEMTYPE_SIZEOF(type));
 
     in->type.type = type;
@@ -149,5 +160,5 @@
 }
 
-psVector *psVectorSort( psVector *restrict outVector, const psVector *restrict inVector )
+psVector *psVectorSort(psVector * restrict outVector, const psVector * restrict inVector)
 {
     int inN = 0;
@@ -158,6 +169,6 @@
     psElemType inType = 0;
 
-    if ( inVector == NULL ) {
-        psError( __func__, " : Line %d - Null input vector\n", __LINE__ );
+    if (inVector == NULL) {
+        psError(__func__, " : Line %d - Null input vector\n", __LINE__);
         return outVector;
     }
@@ -166,8 +177,8 @@
     inN = inVector->n;
     inVec = inVector->data.V;
-    elSize = PSELEMTYPE_SIZEOF( inType );
-
-    if ( outVector == NULL ) {
-        outVector = psVectorAlloc( inN, inType );
+    elSize = PSELEMTYPE_SIZEOF(inType);
+
+    if (outVector == NULL) {
+        outVector = psVectorAlloc(inN, inType);
         outVector->n = inVector->n;
     }
@@ -176,63 +187,62 @@
     outVec = outVector->data.V;
 
-    if ( inN != outN ) {
-        psError( __func__, " : Line %d - Input and output vector sizes are not equal: in=%d out=%d\n", __LINE__,
-                 inN, outN );
-        return outVector;
-    }
-
-    if ( inType != outVector->type.type ) {
-        psError( __func__, " : Line %d - Input and output vectors are not same type: in=%d out=%d\n", __LINE__,
-                 inType, outVector->type.type );
-        return outVector;
-    }
-
-    if ( inN == 0 ) {
-        psError( __func__, " : Line %d - No elements in use for input vector\n", __LINE__ );
-        return outVector;
-    }
-
-    if ( outN == 0 ) {
-        psError( __func__, " : Line %d - No elements in use for output vector\n", __LINE__ );
-        return outVector;
-    }
-
+    if (inN != outN) {
+        psError(__func__, " : Line %d - Input and output vector sizes are not equal: in=%d out=%d\n",
+                __LINE__, inN, outN);
+        return outVector;
+    }
+
+    if (inType != outVector->type.type) {
+        psError(__func__, " : Line %d - Input and output vectors are not same type: in=%d out=%d\n", __LINE__,
+                inType, outVector->type.type);
+        return outVector;
+    }
+
+    if (inN == 0) {
+        psError(__func__, " : Line %d - No elements in use for input vector\n", __LINE__);
+        return outVector;
+    }
+
+    if (outN == 0) {
+        psError(__func__, " : Line %d - No elements in use for output vector\n", __LINE__);
+        return outVector;
+    }
     // Copy input vector values into output vector
-    memcpy( outVec, inVec, elSize * outN );
+    memcpy(outVec, inVec, elSize * outN);
 
     // Sort output vector
-    switch ( inType ) {
+    switch (inType) {
     case PS_TYPE_U8:
-        qsort( outVec, inN, elSize, psCompareU8 );
+        qsort(outVec, inN, elSize, psCompareU8);
         break;
     case PS_TYPE_U16:
-        qsort( outVec, inN, elSize, psCompareU16 );
+        qsort(outVec, inN, elSize, psCompareU16);
         break;
     case PS_TYPE_U32:
-        qsort( outVec, inN, elSize, psCompareU32 );
+        qsort(outVec, inN, elSize, psCompareU32);
         break;
     case PS_TYPE_U64:
-        qsort( outVec, inN, elSize, psCompareU64 );
+        qsort(outVec, inN, elSize, psCompareU64);
         break;
     case PS_TYPE_S8:
-        qsort( outVec, inN, elSize, psCompareS8 );
+        qsort(outVec, inN, elSize, psCompareS8);
         break;
     case PS_TYPE_S16:
-        qsort( outVec, inN, elSize, psCompareS16 );
+        qsort(outVec, inN, elSize, psCompareS16);
         break;
     case PS_TYPE_S32:
-        qsort( outVec, inN, elSize, psCompareS32 );
+        qsort(outVec, inN, elSize, psCompareS32);
         break;
     case PS_TYPE_S64:
-        qsort( outVec, inN, elSize, psCompareS64 );
+        qsort(outVec, inN, elSize, psCompareS64);
         break;
     case PS_TYPE_F32:
-        qsort( outVec, inN, elSize, psCompareF32 );
+        qsort(outVec, inN, elSize, psCompareF32);
         break;
     case PS_TYPE_F64:
-        qsort( outVec, inN, elSize, psCompareF64 );
+        qsort(outVec, inN, elSize, psCompareF64);
         break;
     default:
-        psError( __func__, " : Line %d - Invalid psType\n", __LINE__ );
+        psError(__func__, " : Line %d - Invalid psType\n", __LINE__);
     }
 
@@ -251,5 +261,5 @@
 }
 
-psVector *psVectorSortIndex( psVector *restrict outVector, const psVector *restrict inVector )
+psVector *psVectorSortIndex(psVector * restrict outVector, const psVector * restrict inVector)
 {
     int inN = 0;
@@ -263,6 +273,6 @@
     psElemType inType = 0;
 
-    if ( inVector == NULL ) {
-        psError( __func__, " : Line %d - Null input vector\n", __LINE__ );
+    if (inVector == NULL) {
+        psError(__func__, " : Line %d - Null input vector\n", __LINE__);
         return outVector;
     }
@@ -272,6 +282,6 @@
     inType = inVector->type.type;
 
-    if ( outVector == NULL ) {
-        outVector = psVectorAlloc( inN, PS_TYPE_U32 );
+    if (outVector == NULL) {
+        outVector = psVectorAlloc(inN, PS_TYPE_U32);
         outVector->n = inN;
     }
@@ -280,68 +290,68 @@
     outVec = outVector->data.V;
 
-    if ( inN != outN ) {
-        psError( __func__, " : Line %d - Input and output vector sizes are not equal: in=%d out=%d\n",
-                 __LINE__, inN, outN );
-        return outVector;
-    }
-
-    if ( outVector->type.type != PS_TYPE_U32 ) {
-        psError( __func__, " : Line %d - Output vector is not of type U32: out=%d\n",
-                 __LINE__, outVector->type.type );
-        return outVector;
-    }
-
-    tmpVector = psVectorAlloc( inN, inType );
+    if (inN != outN) {
+        psError(__func__, " : Line %d - Input and output vector sizes are not equal: in=%d out=%d\n",
+                __LINE__, inN, outN);
+        return outVector;
+    }
+
+    if (outVector->type.type != PS_TYPE_U32) {
+        psError(__func__, " : Line %d - Output vector is not of type U32: out=%d\n",
+                __LINE__, outVector->type.type);
+        return outVector;
+    }
+
+    tmpVector = psVectorAlloc(inN, inType);
     tmpVector->n = inN;
-    tmpVector = psVectorSort( tmpVector, inVector );
+    tmpVector = psVectorSort(tmpVector, inVector);
 
     // Sort output vector
-    switch ( inType ) {
+    switch (inType) {
     case PS_TYPE_U8:
-        SORT_INDICES( U8 );
+        SORT_INDICES(U8);
         break;
     case PS_TYPE_U16:
-        SORT_INDICES( U16 );
+        SORT_INDICES(U16);
         break;
     case PS_TYPE_U32:
-        SORT_INDICES( U32 );
+        SORT_INDICES(U32);
         break;
     case PS_TYPE_U64:
-        SORT_INDICES( U64 );
+        SORT_INDICES(U64);
         break;
     case PS_TYPE_S8:
-        SORT_INDICES( S8 );
+        SORT_INDICES(S8);
         break;
     case PS_TYPE_S16:
-        SORT_INDICES( S16 );
+        SORT_INDICES(S16);
         break;
     case PS_TYPE_S32:
-        SORT_INDICES( S32 );
+        SORT_INDICES(S32);
         break;
     case PS_TYPE_S64:
-        SORT_INDICES( S64 );
+        SORT_INDICES(S64);
         break;
     case PS_TYPE_F32:
-        SORT_INDICES( F32 );
+        SORT_INDICES(F32);
         break;
     case PS_TYPE_F64:
-        SORT_INDICES( F64 );
+        SORT_INDICES(F64);
         break;
     default:
-        psError( __func__, " : Line %d - Invalid psType\n", __LINE__ );
+        psError(__func__, " : Line %d - Invalid psType\n", __LINE__);
     }
 
     // Free temp memory
-    psFree( tmpVector );
+    psFree(tmpVector);
 
     return outVector;
 }
 
-static void vectorFree( psVector *restrict psVec )
-{
-    if ( psVec == NULL ) {
-        return ;
-    }
-
-    psFree( psVec->data.V );
-}
+static void vectorFree(psVector * restrict psVec)
+{
+    if (psVec == NULL) {
+        return;
+    }
+
+    psFree(psVec->data.V);
+}
Index: trunk/psLib/src/collections/psVector.h
===================================================================
--- trunk/psLib/src/collections/psVector.h	(revision 1406)
+++ trunk/psLib/src/collections/psVector.h	(revision 1407)
@@ -1,2 +1,3 @@
+
 /** @file  psVector.h
  *
@@ -11,6 +12,6 @@
  *  @author Ross Harman, 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
@@ -18,7 +19,7 @@
 
 #ifndef PS_VECTOR_H
-#define PS_VECTOR_H
+#    define PS_VECTOR_H
 
-#include "psType.h"
+#    include "psType.h"
 
 /// @addtogroup Vector
@@ -32,28 +33,30 @@
 typedef struct
 {
-    psType type;                        ///< Type of data.
-    unsigned int nalloc;                ///< Total number of elements available.
-    unsigned int n;                     ///< Number of elements in use.
+    psType type;                // /< Type of data.
+    unsigned int nalloc;        // /< Total number of elements available.
+    unsigned int n;             // /< Number of elements in use.
 
     union {
-        psU8    *U8;                    ///< Unsigned 8-bit integer data.
-        psU16   *U16;                   ///< Unsigned 16-bit integer data.
-        psU32   *U32;                   ///< Unsigned 32-bit integer data.
-        psU64   *U64;                   ///< Unsigned 64-bit integer data.
-        psS8    *S8;                    ///< Signed 8-bit integer data.
-        psS16   *S16;                   ///< Signed 16-bit integer data.
-        psS32   *S32;                   ///< Signed 32-bit integer data.
-        psS64   *S64;                   ///< Signed 64-bit integer data.
-        psF32   *F32;                   ///< Single-precision float data.
-        psF64   *F64;                   ///< Double-precision float data.
-        psC32   *C32;                   ///< Single-precision complex data.
-        psC64   *C64;                   ///< Double-precision complex data.
-        psPTR    V;                     ///< Pointer to data.
-    } data;                             ///< Union for data types.
+        psU8 *U8;               // /< Unsigned 8-bit integer data.
+        psU16 *U16;             // /< Unsigned 16-bit integer data.
+        psU32 *U32;             // /< Unsigned 32-bit integer data.
+        psU64 *U64;             // /< Unsigned 64-bit integer data.
+        psS8 *S8;               // /< Signed 8-bit integer data.
+        psS16 *S16;             // /< Signed 16-bit integer data.
+        psS32 *S32;             // /< Signed 32-bit integer data.
+        psS64 *S64;             // /< Signed 64-bit integer data.
+        psF32 *F32;             // /< Single-precision float data.
+        psF64 *F64;             // /< Double-precision float data.
+        psC32 *C32;             // /< Single-precision complex data.
+        psC64 *C64;             // /< Double-precision complex data.
+        psPTR V;                // /< Pointer to data.
+    } data;                     // /< Union for data types.
 }
 psVector;
 
 /*****************************************************************************/
+
 /* FUNCTION PROTOTYPES                                                       */
+
 /*****************************************************************************/
 
@@ -65,8 +68,7 @@
  *
  */
-psVector *psVectorAlloc(
-    unsigned int nalloc,                ///< Total number of elements to make available.
-    psElemType dataType                 ///< Type of data to be held by vector.
-);
+psVector *psVectorAlloc(unsigned int nalloc,    // /< Total number of elements to make available.
+                        psElemType dataType     // /< Type of data to be held by vector.
+                       );
 
 /** Reallocate a vector.
@@ -78,8 +80,7 @@
  *
  */
-psVector *psVectorRealloc(
-    unsigned int nalloc,                ///< Total number of elements to make available.
-    psVector *restrict psVec            ///< Vector to reallocate.
-);
+psVector *psVectorRealloc(unsigned int nalloc,  // /< Total number of elements to make available.
+                          psVector * restrict psVec     // /< Vector to reallocate.
+                         );
 
 /** Recycle a vector.
@@ -91,11 +92,10 @@
  *
  */
-psVector *psVectorRecycle(
-    psVector *restrict psVec,
-    ///< Vector to recycle.  If NULL, a new vector is created.  No effort taken to preserve the values.
-
-    unsigned int nalloc,                ///< Total number of elements to make available.
-    psElemType type                     ///< the datatype of the returned vector
-);
+psVector *psVectorRecycle(psVector * restrict psVec,
+                          // /< Vector to recycle.  If NULL, a new vector is created.  No effort taken to
+                          // preserve the values.
+                          unsigned int nalloc,  // /< Total number of elements to make available.
+                          psElemType type       // /< the datatype of the returned vector
+                         );
 
 /** Sort an array of floats.
@@ -107,8 +107,8 @@
  */
 
-psVector *psVectorSort(
-    psVector *restrict outVector,  ///< the output vector to recycle, or NULL if new vector desired.
-    const psVector *restrict inVector ///< the vector to sort.
-);
+psVector *psVectorSort(psVector * restrict outVector,   // /< the output vector to recycle, or NULL if new
+                       // vector desired.
+                       const psVector * restrict inVector       // /< the vector to sort.
+                      );
 
 /** Creates an array of indices based on sort odred of float array.
@@ -120,9 +120,5 @@
  */
 
-psVector *psVectorSortIndex(
-    psVector *restrict outVector,
-    const psVector *restrict inVector
-);
-
+psVector *psVectorSortIndex(psVector * restrict outVector, const psVector * restrict inVector);
 
 /// @}
