Index: /trunk/psLib/src/collections/psSort.c
===================================================================
--- /trunk/psLib/src/collections/psSort.c	(revision 449)
+++ /trunk/psLib/src/collections/psSort.c	(revision 450)
@@ -1,5 +1,5 @@
-/** @file  psSort.h
- *
- *  @brief Sorts an array of floats
+/** @file  psSort.c
+ *
+ *  @brief Sorts arrays
  *
  *  The psSort functions use the qsort() stdlib function with a user-defined callback to sort an array of 
@@ -14,6 +14,6 @@
  *  @author Ross Harman, MHPCC
  *   
- *  @version $Revision: 1.2 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2004-04-17 02:43:59 $
+ *  @version $Revision: 1.3 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2004-04-19 20:10:46 $
  *
  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -32,4 +32,5 @@
 #include "psArray.h"
 #include "psSort.h"
+#include "psError.h"
 
 /******************************************************************************/
@@ -80,5 +81,5 @@
     
     if(x == NULL || y == NULL) {
-        printf("Null input argument\n");
+        psError(__func__, " : Line %d - Null input argument: x=%d y=%d\n", __LINE__, x, y);
     }
     
@@ -87,5 +88,5 @@
     
     if(item1 == NULL || item2 == NULL) {
-        printf("Improper cast to float\n");
+        psError(__func__, " : Line %d - Improper cast to float: item1=%d item2=%d\n", __LINE__, item1, item2);
     }
     
@@ -101,11 +102,8 @@
 }
 
-/** Sort an array of floats.
- *
- *  Sorts an array of floats in ascendin order with the qsort() stdlib function.
- *
- *  @return  psFloatArray*: Pointer to sorted psFloatArray.
- */
- 
+/*****************************************************************************/
+/* FUNCTION IMPLEMENTATION - PUBLIC                                          */
+/*****************************************************************************/
+
 psFloatArray *psSort(
     psFloatArray *restrict outArray,        /**< Sorted output array. */
@@ -121,10 +119,10 @@
 
     if(outArray == NULL) {
-        printf("NULL output array n");
+        psError(__func__, " : Line %d - Null output array\n", __LINE__);
         return outArray;
     }
     
     if(inArray == NULL) {
-        printf("NULL input array\n");
+        psError(__func__, " : Line %d - Null input array\n", __LINE__);
         return outArray;
     }
@@ -138,5 +136,6 @@
     
     if(inN != outN) {
-        printf("Input and output array sizes are not equal");
+        psError(__func__, " : Line %d - Input and output array sizes are not equal: in=%d out=%d\n", __LINE__,
+                inN, outN);
         return outArray;
     }
@@ -152,12 +151,4 @@
     return outArray;
 }
-
-/** Creates an array of indices based on sort odred of float array.
- *
- *  Sorts an array of floats and creates an integer array holding indices of sorted float values based on 
- *  pre-sort index positions.
- *
- *  @return  psIntArray*: Pointer to psIntArray of sorted indices.
- */
 
 psIntArray *psSortIndex(
@@ -177,10 +168,10 @@
     
     if(outArray == NULL) {
-        printf("NULL output array n");
+        psError(__func__, " : Line %d - Null output array\n", __LINE__);
         return outArray;
     }
     
     if(inArray == NULL) {
-        printf("NULL input array\n");
+        psError(__func__, " : Line %d - Null input array\n", __LINE__);
         return outArray;
     }
@@ -193,5 +184,6 @@
 
     if(inN != outN) {
-        printf("Input and output array sizes are not equal");
+        psError(__func__, " : Line %d - Input and output array sizes are not equal: in=%d out=%d\n", __LINE__,
+                inN, outN);
         return outArray;
     }
Index: /trunk/psLib/src/collections/psSort.h
===================================================================
--- /trunk/psLib/src/collections/psSort.h	(revision 449)
+++ /trunk/psLib/src/collections/psSort.h	(revision 450)
@@ -1,2 +1,60 @@
+/** @file  psSort.h
+ *
+ *  @brief Sorts arrays
+ *
+ *  The psSort functions use the qsort() stdlib function with a user-defined callback to sort an array of 
+ *  floats. The qsort function requires the starting point of the array, number of elements in the array, size 
+ *  of each element, and a pointer to a callback comparison function. Once called, qsort() will sort the array
+ *  contents in ascending order according to the comparison function. The comparison function is called with
+ *  two arguments that point to the objects being compared - in this case two floats. The comparison function 
+ *  must return an integer less than, equal to, or greater than zero if the first argument is considered to be
+ *  respectively less than, equal to, or greater than the second. If two members compare as equal, their order
+ *  in the sorted array is undefined.
+ *
+ *  @author Ross Harman, MHPCC
+ *   
+ *  @version $Revision: 1.2 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2004-04-19 20:10:46 $
+ *
+ *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
+ */
+ 
+#ifndef PSSORT_H
+#define PSSORT_H
+
+/******************************************************************************/
+/*  DEFINE STATEMENTS                                                         */
+/******************************************************************************/
+
+// None
+
+/******************************************************************************/
+/*  TYPE DEFINITIONS                                                          */
+/******************************************************************************/
+
+// None
+
+/*****************************************************************************/
+/* FUNCTION PROTOTYPES                                                       */
+/*****************************************************************************/
+ 
+/** Sort an array of floats.
+ *
+ *  Sorts an array of floats in ascendin order with the qsort() stdlib function.
+ *
+ *  @return  psFloatArray*: Pointer to sorted psFloatArray.
+ */
+
 psFloatArray *psSort(psFloatArray *restrict out, const psFloatArray *restrict inArray);
+
+/** Creates an array of indices based on sort odred of float array.
+ *
+ *  Sorts an array of floats and creates an integer array holding indices of sorted float values based on 
+ *  pre-sort index positions.
+ *
+ *  @return  psIntArray*: Pointer to psIntArray of sorted indices.
+ */
+
 psIntArray *psSortIndex(psIntArray *restrict out, const psFloatArray *restrict inArray);
+
+#endif
