Index: /trunk/psLib/src/sys/psAbort.c
===================================================================
--- /trunk/psLib/src/sys/psAbort.c	(revision 483)
+++ /trunk/psLib/src/sys/psAbort.c	(revision 484)
@@ -9,6 +9,6 @@
  *  @author Eric Van Alst, MHPCC
  *   
- *  @version $Revision: 1.2 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2004-04-16 02:18:57 $
+ *  @version $Revision: 1.3 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2004-04-21 00:15:17 $
  *
  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -65,5 +65,5 @@
 
     // Call logging function with PS_LOG_ABORT level
-    psVLogMsg(name, PS_LOG_ABORT, fmt, argPtr);
+    psLogMsg(name, PS_LOG_ABORT, fmt, argPtr);
 
     // Clean up stack after variable arguement has been used
Index: /trunk/psLib/src/sys/psError.c
===================================================================
--- /trunk/psLib/src/sys/psError.c	(revision 483)
+++ /trunk/psLib/src/sys/psError.c	(revision 484)
@@ -10,6 +10,6 @@
  *  @author Eric Van Alst, MHPCC
  *   
- *  @version $Revision: 1.3 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2004-04-20 02:30:07 $
+ *  @version $Revision: 1.4 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2004-04-21 00:15:17 $
  *
  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -65,5 +65,5 @@
 
     // Call logging function with PS_LOG_ERROR level
-    psVLogMsg(name, PS_LOG_ERROR, fmt, argPtr);
+    psLogMsg(name, PS_LOG_ERROR, fmt, argPtr);
 
     // Clean up stack after variable arguement has been used
Index: /trunk/psLib/src/sys/psLogMsg.c
===================================================================
--- /trunk/psLib/src/sys/psLogMsg.c	(revision 483)
+++ /trunk/psLib/src/sys/psLogMsg.c	(revision 484)
@@ -9,4 +9,5 @@
 #include <time.h>
 #include <unistd.h>
+
 /* #include "psLib.h" */
 #include "psLogMsg.h"
@@ -160,5 +161,5 @@
  level
  fmt
- ap
+ app_psVLogMsg
     Output:
  none
Index: /trunk/psLib/src/sysUtils/psAbort.c
===================================================================
--- /trunk/psLib/src/sysUtils/psAbort.c	(revision 483)
+++ /trunk/psLib/src/sysUtils/psAbort.c	(revision 484)
@@ -9,6 +9,6 @@
  *  @author Eric Van Alst, MHPCC
  *   
- *  @version $Revision: 1.2 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2004-04-16 02:18:57 $
+ *  @version $Revision: 1.3 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2004-04-21 00:15:17 $
  *
  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -65,5 +65,5 @@
 
     // Call logging function with PS_LOG_ABORT level
-    psVLogMsg(name, PS_LOG_ABORT, fmt, argPtr);
+    psLogMsg(name, PS_LOG_ABORT, fmt, argPtr);
 
     // Clean up stack after variable arguement has been used
Index: /trunk/psLib/src/sysUtils/psDList.c
===================================================================
--- /trunk/psLib/src/sysUtils/psDList.c	(revision 483)
+++ /trunk/psLib/src/sysUtils/psDList.c	(revision 484)
@@ -6,6 +6,6 @@
  *  @author Robert Daniel DeSonia, MHPCC
  *
- *  @version $Revision: 1.3 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2004-04-20 01:38:34 $
+ *  @version $Revision: 1.4 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2004-04-21 00:15:17 $
  *
  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -77,8 +77,23 @@
 
     if (where > list->n) {
-        psError(__FILE__, "Invalid index %d (only %d elements in psDList).", where, list->n);
-        dlistElemFree(elem);  // cleanup just allocated element
-
-        return list;
+        psError(__FILE__, "Invalid index %d (only %d elements in psDList); assuming tail.", where, list->n);
+        where = PS_DLIST_TAIL;
+    }
+
+    if (where == PS_DLIST_PREVIOUS) {
+        if (list->iter == NULL) { // if no iterator position, just insert it in the front of the list.
+            where = PS_DLIST_HEAD;
+        } else {
+            elem->prev = list->iter->prev;
+            elem->next = list->iter;
+            elem->data = psMemIncrRefCounter(data);
+
+            list->iter->prev = elem;
+            if (elem->prev != NULL) {
+                elem->prev->next = elem;
+            }
+
+            list->n++;
+        }
     }
 
@@ -111,37 +126,25 @@
         }
         list->n++;
-    } else if (where == PS_DLIST_PREVIOUS) {
-        if (list->iter == NULL) { // if no position, just insert it in the front of the list.
-            return psDlistAdd(list,data,PS_DLIST_HEAD);
-        }
-        elem->prev = list->iter->prev;
-        elem->next = list->iter;
-        elem->data = psMemIncrRefCounter(data);
-
-        list->iter->prev = elem;
-        if (elem->prev != NULL) {
-            elem->prev->next = elem;
-        }
-
-        list->n++;
-    } else if (where == PS_DLIST_NEXT) {
-        if (list->iter == NULL) {
-            return psDlistAdd(list,data,PS_DLIST_TAIL);
-        }
-        elem->prev = list->iter;
-        elem->next = list->iter->next;
-        elem->data = psMemIncrRefCounter(data);
-
-        list->iter->next = elem;
-        if (elem->next != NULL) {
-            elem->next->prev = elem;
-        }
-
-        list->n++;
-    } else if (where < 0) {
-        /// XXX What is the best way to communicate this failure to the caller?
-        psError(__func__,"The given insert location (%i) for psDlistAdd is invalid.",where);
-    } else {
-    }
+    } else
+        else if (where == PS_DLIST_NEXT) {
+            if (list->iter == NULL) {
+                return psDlistAdd(list,data,PS_DLIST_TAIL);
+            }
+            elem->prev = list->iter;
+            elem->next = list->iter->next;
+            elem->data = psMemIncrRefCounter(data);
+
+            list->iter->next = elem;
+            if (elem->next != NULL) {
+                elem->next->prev = elem;
+            }
+
+            list->n++;
+        } else if (where < 0) {
+            /// XXX What is the best way to communicate this failure to the caller?
+            psError(__func__,"The given insert location (%i) for psDlistAdd is invalid. "
+                    "Adding to head instead.",where);
+            return psDlistAdd(list,data,PS_DLIST_HEAD); // should add it somewhere...
+        } else {}
 
     return list;
@@ -248,5 +251,4 @@
 }
 
-/*****************************************************************************/
 /*
  * Retrieve an element from the list, or iterate over list.
@@ -316,78 +318,75 @@
 }
 
-/*****************************************************************************/
-/*
- * Some wrappers for those iteration calls using psDlistGet.
- *
- * First a call to set the iteration pointer to the head of the list
- */
-void psDlistSetIterator(psDlist *list,
-                        int where)
-{
-    if (where != PS_DLIST_HEAD && where != PS_DLIST_TAIL) {
-        psError(__func__, "Invalid where argument: %d; assuming PS_DLIST_HEAD", where);
-        where = PS_DLIST_HEAD;
-    }
-
-    psDlistGet(list, where); // initialise iterator at head/tail
-}
-
-/*
- * and now return the previous/next element of the list
- */
-void *psDlistGetNext(psDlist *list)
-{
-    return psDlistGet(list, PS_DLIST_NEXT);
-}
-
-void *psDlistGetPrevious(psDlist *list)
-{
-    return psDlistGet(list, PS_DLIST_PREVIOUS);
-}
-
-void *psDlistGetCurrent(psDlist *list)
-{
-    return psDlistGet(list, PS_DLIST_CURRENT);
-}
-
-#if 0
-/*
- * Convert a psDlist to/from a psVoidPtrArray
- */
-psVoidPtrArray *psDlistToArray(psDlist *restrict dlist)
-{
-    if (dlist == NULL) {
-        return NULL;
-    }
-
-    psVoidPtrArray *restrict arr = psVoidPtrArrayAlloc(dlist->n, dlist->n);
-
-    psDlistElem *ptr = dlist->head;
-    for (int i = 0, n = dlist->n; i < n; i++) {
-        arr->arr[i] = ptr->data;
-
-        ptr->data = NULL;
-        ptr = ptr->next;
-    }
-
-    psDlistFree(dlist, NULL);
-
-    return arr;
-}
-
-psDlist *psArrayToDlist(psVoidPtrArray *arr)
-{
-    psDlist *list = psDlistAlloc(NULL); // list of elements
-
-    for (int i = 0, n = arr->n; i < n; i++) {
-        psDlistAppend(list,
-                      psMemDecrRefCounter(arr->arr[i])); // it's already Incr
-        arr->arr[i] = NULL;
-    }
-
-    psVoidPtrArrayFree(arr, NULL);
-
-    return list;
-}
-
-#endif
+psDlistElem* dlistGetIterator(psDlist* list)
+{
+
+
+    /*
+     * Some wrappers for those iteration calls using psDlistGet.
+     *
+     * First a call to set the iteration pointer to the head of the list
+     */
+    void psDlistSetIterator(psDlist *list,
+                            int where) {
+        if (where != PS_DLIST_HEAD && where != PS_DLIST_TAIL) {
+            psError(__func__, "Invalid where argument: %d; assuming PS_DLIST_HEAD", where);
+            where = PS_DLIST_HEAD;
+        }
+
+        psDlistGet(list, where); // initialise iterator at head/tail
+    }
+
+    /*
+     * and now return the previous/next element of the list
+     */
+    void *psDlistGetNext(psDlist *list) {
+        return psDlistGet(list, PS_DLIST_NEXT);
+    }
+
+    void *psDlistGetPrevious(psDlist *list) {
+        return psDlistGet(list, PS_DLIST_PREVIOUS);
+    }
+
+    void *psDlistGetCurrent(psDlist *list) {
+        return psDlistGet(list, PS_DLIST_CURRENT);
+    }
+
+    #if 0
+    /*
+     * Convert a psDlist to/from a psVoidPtrArray
+     */
+    psVoidPtrArray *psDlistToArray(psDlist *restrict dlist) {
+        if (dlist == NULL) {
+            return NULL;
+        }
+
+        psVoidPtrArray *restrict arr = psVoidPtrArrayAlloc(dlist->n, dlist->n);
+
+        psDlistElem *ptr = dlist->head;
+        for (int i = 0, n = dlist->n; i < n; i++) {
+            arr->arr[i] = ptr->data;
+
+            ptr->data = NULL;
+            ptr = ptr->next;
+        }
+
+        psDlistFree(dlist, NULL);
+
+        return arr;
+    }
+
+    psDlist *psArrayToDlist(psVoidPtrArray *arr) {
+        psDlist *list = psDlistAlloc(NULL); // list of elements
+
+        for (int i = 0, n = arr->n; i < n; i++) {
+            psDlistAppend(list,
+                          psMemDecrRefCounter(arr->arr[i])); // it's already Incr
+            arr->arr[i] = NULL;
+        }
+
+        psVoidPtrArrayFree(arr, NULL);
+
+        return list;
+    }
+
+    #endif
Index: /trunk/psLib/src/sysUtils/psDList.h
===================================================================
--- /trunk/psLib/src/sysUtils/psDList.h	(revision 483)
+++ /trunk/psLib/src/sysUtils/psDList.h	(revision 484)
@@ -9,6 +9,6 @@
  *  @author Robert Daniel DeSonia, MHPCC
  *
- *  @version $Revision: 1.4 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2004-04-20 01:38:34 $
+ *  @version $Revision: 1.5 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2004-04-21 00:15:17 $
  *
  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -38,7 +38,7 @@
 {
     int n;                              ///< number of elements on list
-    psDlistElem *head;                  ///< first element on list (may be NULL)
-    psDlistElem *tail;                  ///< last element on list (may be NULL)
-    psDlistElem *iter;                  ///< iteration cursor
+    psDlistElem* head;                  ///< first element on list (may be NULL)
+    psDlistElem* tail;                  ///< last element on list (may be NULL)
+    psDlistElem* iter;                  ///< iteration cursor
     int iterIndex;
 }
Index: /trunk/psLib/src/sysUtils/psError.c
===================================================================
--- /trunk/psLib/src/sysUtils/psError.c	(revision 483)
+++ /trunk/psLib/src/sysUtils/psError.c	(revision 484)
@@ -10,6 +10,6 @@
  *  @author Eric Van Alst, MHPCC
  *   
- *  @version $Revision: 1.3 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2004-04-20 02:30:07 $
+ *  @version $Revision: 1.4 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2004-04-21 00:15:17 $
  *
  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -65,5 +65,5 @@
 
     // Call logging function with PS_LOG_ERROR level
-    psVLogMsg(name, PS_LOG_ERROR, fmt, argPtr);
+    psLogMsg(name, PS_LOG_ERROR, fmt, argPtr);
 
     // Clean up stack after variable arguement has been used
Index: /trunk/psLib/src/sysUtils/psLogMsg.c
===================================================================
--- /trunk/psLib/src/sysUtils/psLogMsg.c	(revision 483)
+++ /trunk/psLib/src/sysUtils/psLogMsg.c	(revision 484)
@@ -9,4 +9,5 @@
 #include <time.h>
 #include <unistd.h>
+
 /* #include "psLib.h" */
 #include "psLogMsg.h"
@@ -160,5 +161,5 @@
  level
  fmt
- ap
+ app_psVLogMsg
     Output:
  none
