Index: /trunk/psLib/src/collections/psCollectionsErrors.dat
===================================================================
--- /trunk/psLib/src/collections/psCollectionsErrors.dat	(revision 3106)
+++ /trunk/psLib/src/collections/psCollectionsErrors.dat	(revision 3107)
@@ -37,4 +37,5 @@
 psList_ITERATOR_INVALID                Specified iterator is not valid.
 psList_ITERATOR_NULL                   Specified iterator is NULL.
+psList_ITERATOR_NONMUTABLE             Specified iterator indicates list is non-mutable.
 psList_LIST_NULL                       Specified psList reference is NULL.
 psList_DATA_NULL                       Specified data item is NULL.
Index: /trunk/psLib/src/collections/psCollectionsErrors.h
===================================================================
--- /trunk/psLib/src/collections/psCollectionsErrors.h	(revision 3106)
+++ /trunk/psLib/src/collections/psCollectionsErrors.h	(revision 3107)
@@ -7,6 +7,6 @@
  *  @author Robert DeSonia, MHPCC
  *
- *  @version $Revision: 1.8 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2004-12-30 20:18:36 $
+ *  @version $Revision: 1.9 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2005-02-02 20:21:48 $
  *
  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -54,4 +54,5 @@
 #define PS_ERRORTEXT_psList_ITERATOR_INVALID "Specified iterator is not valid."
 #define PS_ERRORTEXT_psList_ITERATOR_NULL "Specified iterator is NULL."
+#define PS_ERRORTEXT_psList_ITERATOR_NONMUTABLE "Specified iterator indicates list is non-mutable."
 #define PS_ERRORTEXT_psList_LIST_NULL "Specified psList reference is NULL."
 #define PS_ERRORTEXT_psList_DATA_NULL "Specified data item is NULL."
Index: /trunk/psLib/src/collections/psList.c
===================================================================
--- /trunk/psLib/src/collections/psList.c	(revision 3106)
+++ /trunk/psLib/src/collections/psList.c	(revision 3107)
@@ -6,6 +6,6 @@
  *  @author Robert Daniel DeSonia, MHPCC
  *
- *  @version $Revision: 1.30 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2005-01-25 01:04:17 $
+ *  @version $Revision: 1.31 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2005-02-02 20:21:48 $
  *
  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -137,5 +137,5 @@
 
     // create a default iterator
-    psListIteratorAlloc(list,PS_LIST_HEAD);
+    psListIteratorAlloc(list,PS_LIST_HEAD,true);
 
     pthread_mutex_init(&(list->lock), NULL)
@@ -149,5 +149,5 @@
 }
 
-psListIterator* psListIteratorAlloc(psList* list, int location)
+psListIterator* psListIteratorAlloc(psList* list, int location, bool mutable)
 {
     psListIterator* iter = psAlloc(sizeof(psListIterator));
@@ -160,4 +160,5 @@
     iter->index = 0;
     iter->offEnd = false;
+    iter->mutable = mutable;
 
     // add to the list's array of iterators
@@ -201,4 +202,8 @@
         iterator->offEnd = false;
         return true;
+    }
+
+    if (location < 0) {
+        location = list->size + location;
     }
 
@@ -289,4 +294,11 @@
         psError(PS_ERR_BAD_PARAMETER_NULL, true,
                 PS_ERRORTEXT_psList_ITERATOR_NULL);
+        return false;
+    }
+
+    // Check if the list pointed by the iterator can be changed
+    if (!iterator->mutable) {
+        psError(PS_ERR_BAD_PARAMETER_NULL, true,
+                PS_ERRORTEXT_psList_ITERATOR_NONMUTABLE);
         return false;
     }
@@ -360,4 +372,11 @@
     }
 
+    // Check if the list pointed by the iterator can be changed
+    if (!iterator->mutable) {
+        psError(PS_ERR_BAD_PARAMETER_NULL, true,
+                PS_ERRORTEXT_psList_ITERATOR_NONMUTABLE);
+        return false;
+    }
+
     psListElem* cursor = iterator->cursor;
     psList* list = iterator->list;
@@ -493,5 +512,5 @@
  * and now return the previous/next element of the list
  */
-psPtr psListGetNext(psListIterator* iterator)
+psPtr psListGetAndIncrement(psListIterator* iterator)
 {
     if (iterator == NULL ) {
@@ -518,5 +537,5 @@
 }
 
-psPtr psListGetPrevious(psListIterator* iterator)
+psPtr psListGetAndDecrement(psListIterator* iterator)
 {
     if (iterator == NULL ) {
Index: /trunk/psLib/src/collections/psList.h
===================================================================
--- /trunk/psLib/src/collections/psList.h	(revision 3106)
+++ /trunk/psLib/src/collections/psList.h	(revision 3107)
@@ -10,6 +10,6 @@
  *  @ingroup LinkedList
  *
- *  @version $Revision: 1.18 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2004-12-10 02:50:14 $
+ *  @version $Revision: 1.19 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2005-02-02 20:21:48 $
  *
  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -78,4 +78,5 @@
 int index;                         ///< the index number in the list
 bool offEnd;                       ///< Iterator off the end?
+bool mutable;                      ///< Is it permissible to modify the list?
 }
 psListIterator;
@@ -98,6 +99,7 @@
 psListIterator* psListIteratorAlloc(
     psList* list,                      ///< the psList to iterate with
-    int location                       ///< the initial starting point.
+    int location,                      ///< the initial starting point.
     ///<  This can be a numeric index, PS_LIST_HEAD, or PS_LIST_TAIL.
+    bool mutable                       ///< Is it permissible to modify list?
 );
 
@@ -175,5 +177,5 @@
  *                      iterator goes past the end of the list.
  */
-psPtr psListGetNext(
+psPtr psListGetAndIncrement(
     psListIterator* restrict iterator  ///< iterator to move
 );
@@ -184,5 +186,5 @@
  *                      iterator goes past the beginning of the list.
  */
-psPtr psListGetPrevious(
+psPtr psListGetAndDecrement(
     psListIterator* restrict iterator  ///< iterator to move
 );
Index: /trunk/psLib/src/sys/psErrorCodes.c
===================================================================
--- /trunk/psLib/src/sys/psErrorCodes.c	(revision 3106)
+++ /trunk/psLib/src/sys/psErrorCodes.c	(revision 3107)
@@ -7,6 +7,6 @@
  *  @author Robert DeSonia, MHPCC
  *
- *  @version $Revision: 1.14 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2004-12-13 20:49:56 $
+ *  @version $Revision: 1.15 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2005-02-02 20:22:22 $
  *
  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -76,6 +76,6 @@
 
         // search dynamic list of error descriptions before giving up.
-        psListIterator* iter = psListIteratorAlloc(dynamicErrorCodes,PS_LIST_HEAD);
-        while ((desc = (psErrorDescription*)psListGetNext(iter)) != NULL) {
+        psListIterator* iter = psListIteratorAlloc(dynamicErrorCodes,PS_LIST_HEAD,true);
+        while ((desc = (psErrorDescription*)psListGetAndIncrement(iter)) != NULL) {
             if (desc->code == code) {
                 psFree(iter);
Index: /trunk/psLib/src/sysUtils/psErrorCodes.c
===================================================================
--- /trunk/psLib/src/sysUtils/psErrorCodes.c	(revision 3106)
+++ /trunk/psLib/src/sysUtils/psErrorCodes.c	(revision 3107)
@@ -7,6 +7,6 @@
  *  @author Robert DeSonia, MHPCC
  *
- *  @version $Revision: 1.14 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2004-12-13 20:49:56 $
+ *  @version $Revision: 1.15 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2005-02-02 20:22:22 $
  *
  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -76,6 +76,6 @@
 
         // search dynamic list of error descriptions before giving up.
-        psListIterator* iter = psListIteratorAlloc(dynamicErrorCodes,PS_LIST_HEAD);
-        while ((desc = (psErrorDescription*)psListGetNext(iter)) != NULL) {
+        psListIterator* iter = psListIteratorAlloc(dynamicErrorCodes,PS_LIST_HEAD,true);
+        while ((desc = (psErrorDescription*)psListGetAndIncrement(iter)) != NULL) {
             if (desc->code == code) {
                 psFree(iter);
Index: /trunk/psLib/src/types/psList.c
===================================================================
--- /trunk/psLib/src/types/psList.c	(revision 3106)
+++ /trunk/psLib/src/types/psList.c	(revision 3107)
@@ -6,6 +6,6 @@
  *  @author Robert Daniel DeSonia, MHPCC
  *
- *  @version $Revision: 1.30 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2005-01-25 01:04:17 $
+ *  @version $Revision: 1.31 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2005-02-02 20:21:48 $
  *
  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -137,5 +137,5 @@
 
     // create a default iterator
-    psListIteratorAlloc(list,PS_LIST_HEAD);
+    psListIteratorAlloc(list,PS_LIST_HEAD,true);
 
     pthread_mutex_init(&(list->lock), NULL)
@@ -149,5 +149,5 @@
 }
 
-psListIterator* psListIteratorAlloc(psList* list, int location)
+psListIterator* psListIteratorAlloc(psList* list, int location, bool mutable)
 {
     psListIterator* iter = psAlloc(sizeof(psListIterator));
@@ -160,4 +160,5 @@
     iter->index = 0;
     iter->offEnd = false;
+    iter->mutable = mutable;
 
     // add to the list's array of iterators
@@ -201,4 +202,8 @@
         iterator->offEnd = false;
         return true;
+    }
+
+    if (location < 0) {
+        location = list->size + location;
     }
 
@@ -289,4 +294,11 @@
         psError(PS_ERR_BAD_PARAMETER_NULL, true,
                 PS_ERRORTEXT_psList_ITERATOR_NULL);
+        return false;
+    }
+
+    // Check if the list pointed by the iterator can be changed
+    if (!iterator->mutable) {
+        psError(PS_ERR_BAD_PARAMETER_NULL, true,
+                PS_ERRORTEXT_psList_ITERATOR_NONMUTABLE);
         return false;
     }
@@ -360,4 +372,11 @@
     }
 
+    // Check if the list pointed by the iterator can be changed
+    if (!iterator->mutable) {
+        psError(PS_ERR_BAD_PARAMETER_NULL, true,
+                PS_ERRORTEXT_psList_ITERATOR_NONMUTABLE);
+        return false;
+    }
+
     psListElem* cursor = iterator->cursor;
     psList* list = iterator->list;
@@ -493,5 +512,5 @@
  * and now return the previous/next element of the list
  */
-psPtr psListGetNext(psListIterator* iterator)
+psPtr psListGetAndIncrement(psListIterator* iterator)
 {
     if (iterator == NULL ) {
@@ -518,5 +537,5 @@
 }
 
-psPtr psListGetPrevious(psListIterator* iterator)
+psPtr psListGetAndDecrement(psListIterator* iterator)
 {
     if (iterator == NULL ) {
Index: /trunk/psLib/src/types/psList.h
===================================================================
--- /trunk/psLib/src/types/psList.h	(revision 3106)
+++ /trunk/psLib/src/types/psList.h	(revision 3107)
@@ -10,6 +10,6 @@
  *  @ingroup LinkedList
  *
- *  @version $Revision: 1.18 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2004-12-10 02:50:14 $
+ *  @version $Revision: 1.19 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2005-02-02 20:21:48 $
  *
  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -78,4 +78,5 @@
 int index;                         ///< the index number in the list
 bool offEnd;                       ///< Iterator off the end?
+bool mutable;                      ///< Is it permissible to modify the list?
 }
 psListIterator;
@@ -98,6 +99,7 @@
 psListIterator* psListIteratorAlloc(
     psList* list,                      ///< the psList to iterate with
-    int location                       ///< the initial starting point.
+    int location,                      ///< the initial starting point.
     ///<  This can be a numeric index, PS_LIST_HEAD, or PS_LIST_TAIL.
+    bool mutable                       ///< Is it permissible to modify list?
 );
 
@@ -175,5 +177,5 @@
  *                      iterator goes past the end of the list.
  */
-psPtr psListGetNext(
+psPtr psListGetAndIncrement(
     psListIterator* restrict iterator  ///< iterator to move
 );
@@ -184,5 +186,5 @@
  *                      iterator goes past the beginning of the list.
  */
-psPtr psListGetPrevious(
+psPtr psListGetAndDecrement(
     psListIterator* restrict iterator  ///< iterator to move
 );
Index: /trunk/psLib/test/astronomy/tst_psMetadataIO.c
===================================================================
--- /trunk/psLib/test/astronomy/tst_psMetadataIO.c	(revision 3106)
+++ /trunk/psLib/test/astronomy/tst_psMetadataIO.c	(revision 3107)
@@ -13,6 +13,6 @@
 *  @author  Ross Harman, MHPCC
 *
-*  @version $Revision: 1.6 $  $Name: not supported by cvs2svn $
-*  @date  $Date: 2004-12-10 02:50:15 $
+*  @version $Revision: 1.7 $  $Name: not supported by cvs2svn $
+*  @date  $Date: 2005-02-02 20:20:55 $
 *
 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -41,7 +41,7 @@
     psMetadataItem *entryChild = NULL;
 
-    psListIterator* iter = psListIteratorAlloc(metadataItemList, PS_LIST_HEAD);
+    psListIterator* iter = psListIteratorAlloc(metadataItemList, PS_LIST_HEAD, true);
 
-    while ( (entryChild=psListGetNext(iter)) != NULL) {
+    while ( (entryChild=psListGetAndIncrement(iter)) != NULL) {
         printMetadataItem(entryChild, spaces);
     }
Index: /trunk/psLib/test/astronomy/tst_psMetadata_01.c
===================================================================
--- /trunk/psLib/test/astronomy/tst_psMetadata_01.c	(revision 3106)
+++ /trunk/psLib/test/astronomy/tst_psMetadata_01.c	(revision 3107)
@@ -18,6 +18,6 @@
 *  @author  Ross Harman, MHPCC
 *
-*  @version $Revision: 1.17 $  $Name: not supported by cvs2svn $
-*  @date  $Date: 2004-12-10 02:50:15 $
+*  @version $Revision: 1.18 $  $Name: not supported by cvs2svn $
+*  @date  $Date: 2005-02-02 20:20:55 $
 *
 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -46,7 +46,7 @@
     psMetadataItem *entryChild = NULL;
 
-    psListIterator* iter = psListIteratorAlloc(metadataItemList, PS_LIST_HEAD);
-
-    while ( (entryChild=psListGetNext(iter)) != NULL) {
+    psListIterator* iter = psListIteratorAlloc(metadataItemList, PS_LIST_HEAD, true);
+
+    while ( (entryChild=psListGetAndIncrement(iter)) != NULL) {
         printMetadataItem(entryChild, spaces);
     }
Index: /trunk/psLib/test/collections/tst_psMetadataIO.c
===================================================================
--- /trunk/psLib/test/collections/tst_psMetadataIO.c	(revision 3106)
+++ /trunk/psLib/test/collections/tst_psMetadataIO.c	(revision 3107)
@@ -13,6 +13,6 @@
 *  @author  Ross Harman, MHPCC
 *
-*  @version $Revision: 1.6 $  $Name: not supported by cvs2svn $
-*  @date  $Date: 2004-12-10 02:50:15 $
+*  @version $Revision: 1.7 $  $Name: not supported by cvs2svn $
+*  @date  $Date: 2005-02-02 20:20:55 $
 *
 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -41,7 +41,7 @@
     psMetadataItem *entryChild = NULL;
 
-    psListIterator* iter = psListIteratorAlloc(metadataItemList, PS_LIST_HEAD);
+    psListIterator* iter = psListIteratorAlloc(metadataItemList, PS_LIST_HEAD, true);
 
-    while ( (entryChild=psListGetNext(iter)) != NULL) {
+    while ( (entryChild=psListGetAndIncrement(iter)) != NULL) {
         printMetadataItem(entryChild, spaces);
     }
Index: /trunk/psLib/test/collections/tst_psMetadata_01.c
===================================================================
--- /trunk/psLib/test/collections/tst_psMetadata_01.c	(revision 3106)
+++ /trunk/psLib/test/collections/tst_psMetadata_01.c	(revision 3107)
@@ -18,6 +18,6 @@
 *  @author  Ross Harman, MHPCC
 *
-*  @version $Revision: 1.17 $  $Name: not supported by cvs2svn $
-*  @date  $Date: 2004-12-10 02:50:15 $
+*  @version $Revision: 1.18 $  $Name: not supported by cvs2svn $
+*  @date  $Date: 2005-02-02 20:20:55 $
 *
 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -46,7 +46,7 @@
     psMetadataItem *entryChild = NULL;
 
-    psListIterator* iter = psListIteratorAlloc(metadataItemList, PS_LIST_HEAD);
-
-    while ( (entryChild=psListGetNext(iter)) != NULL) {
+    psListIterator* iter = psListIteratorAlloc(metadataItemList, PS_LIST_HEAD, true);
+
+    while ( (entryChild=psListGetAndIncrement(iter)) != NULL) {
         printMetadataItem(entryChild, spaces);
     }
