Index: trunk/psLib/src/collections/psList.c
===================================================================
--- trunk/psLib/src/collections/psList.c	(revision 2357)
+++ trunk/psLib/src/collections/psList.c	(revision 2375)
@@ -6,6 +6,6 @@
  *  @author Robert Daniel DeSonia, MHPCC
  *
- *  @version $Revision: 1.21 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2004-11-04 01:04:57 $
+ *  @version $Revision: 1.22 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2004-11-16 20:00:20 $
  *
  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -42,6 +42,6 @@
     list->size = 0;
     list->head = list->tail = NULL;
-    list->iter = ITER_INIT_HEAD;
-    list->iterIndex = PS_LIST_HEAD;
+    list->p_iter = ITER_INIT_HEAD;
+    list->p_iterIndex = PS_LIST_HEAD;
 
     pthread_mutex_init(&(list->lock), NULL)
@@ -127,6 +127,6 @@
 
         list->size++;
-        list->iter = elem;
-        list->iterIndex = list->size - 1;
+        list->p_iter = elem;
+        list->p_iterIndex = list->size - 1;
     } else {
         // move ourselves to the given position
@@ -152,6 +152,6 @@
 
         list->size++;
-        list->iter = elem;
-        list->iterIndex = cursorIndex;
+        list->p_iter = elem;
+        list->p_iterIndex = cursorIndex;
     }
 
@@ -227,13 +227,13 @@
         // removed tail, so iter should be the last element of list to keep it valid
         if (list->size > 0) {
-            list->iter = list->tail;
-            list->iterIndex = list->size - 1;
+            list->p_iter = list->tail;
+            list->p_iterIndex = list->size - 1;
         } else {
-            list->iter = ITER_INIT_TAIL;
+            list->p_iter = ITER_INIT_TAIL;
         }
     } else {
         elem->next->prev = elem->prev;
-        list->iter = elem->next;
-        list->iterIndex = cursorIndex;
+        list->p_iter = elem->next;
+        list->p_iterIndex = cursorIndex;
     }
 
@@ -275,5 +275,5 @@
 
     if (where >= (psS32)list->size) {
-        list->iter = NULL;
+        list->p_iter = NULL;
         if (lockList) {
             pthread_mutex_unlock(&list->lock)
@@ -285,9 +285,9 @@
     switch (where) {
     case PS_LIST_HEAD:
-        list->iter = ITER_INIT_HEAD;
+        list->p_iter = ITER_INIT_HEAD;
         break;
 
     case PS_LIST_TAIL:
-        list->iter = ITER_INIT_TAIL;
+        list->p_iter = ITER_INIT_TAIL;
         break;
 
@@ -297,6 +297,6 @@
 
         if (cursor != NULL) {
-            list->iter = cursor->prev;
-            list->iterIndex = position - 1;
+            list->p_iter = cursor->prev;
+            list->p_iterIndex = position - 1;
         }
         break;
@@ -307,6 +307,6 @@
 
         if (cursor != NULL) {
-            list->iter = cursor->next;
-            list->iterIndex = position + 1;
+            list->p_iter = cursor->next;
+            list->p_iterIndex = position + 1;
         }
         break;
@@ -322,6 +322,6 @@
             cursor = listGetIterator(list);
             if (cursor == NULL) {      // reset the iterator if it is invalid
-                list->iter = ITER_INIT_HEAD;
-                list->iterIndex = 0;
+                list->p_iter = ITER_INIT_HEAD;
+                list->p_iterIndex = 0;
             }
 
@@ -357,10 +357,10 @@
     }
 
-    if (list->iter == ITER_INIT_HEAD) {
+    if (list->p_iter == ITER_INIT_HEAD) {
         return list->head;
-    } else if (list->iter == ITER_INIT_TAIL) {
+    } else if (list->p_iter == ITER_INIT_TAIL) {
         return list->tail;
     } else {
-        return list->iter;
+        return list->p_iter;
     }
 }
@@ -368,10 +368,10 @@
 psS32 listGetIteratorIndex(psList* list)
 {
-    if (list->iter == ITER_INIT_HEAD) {
+    if (list->p_iter == ITER_INIT_HEAD) {
         return 0;
-    } else if (list->iter == ITER_INIT_TAIL) {
+    } else if (list->p_iter == ITER_INIT_TAIL) {
         return list->size - 1;
     } else {
-        return list->iterIndex;
+        return list->p_iterIndex;
     }
 }
Index: trunk/psLib/src/collections/psList.h
===================================================================
--- trunk/psLib/src/collections/psList.h	(revision 2357)
+++ trunk/psLib/src/collections/psList.h	(revision 2375)
@@ -10,6 +10,6 @@
  *  @ingroup LinkedList
  *
- *  @version $Revision: 1.16 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2004-10-27 00:57:31 $
+ *  @version $Revision: 1.17 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2004-11-16 20:00:20 $
  *
  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -52,16 +52,35 @@
  *  directly; rather the psListAlloc should be used.
  *
- *  @see psListAlloc, psListFree
+ *  @see psListAlloc
  */
 typedef struct
 {
-    psU32 size;                 ///< number of elements on list
+    psU32 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
-    psU32 iterIndex;            ///< the numeric position of the iteration cursor in the list
+    psArray* iterators;                ///< iterators
     pthread_mutex_t lock;              ///< mutex to lock a node during changes
+psListElem* p_iter;                ///< internal cursor for increased performance index accessing
+int p_iterIndex;                   ///< index position of the iter.
 }
 psList;
+
+/** The psList iterator structure.  This should be allocated via
+ *  psListIteratorAlloc and not directly.
+ *
+ *  The life span of a psListIterator object is ended by either a psFree
+ *  of this structure OR psFree of the psList in which it operates on.
+ *
+ *  @see psListIteratorAlloc, psListIteratorSet, psListGetNext, psListGetPrevious
+ */
+typedef struct
+{
+psList* list;                      ///< List iterator to works on
+psU32 number;                      ///< List iterator number
+psListElem* cursor;                ///< current cursor position
+bool offEnd;                       ///< Iterator off the end?
+}
+psListIterator;
+
 
 /** Creates a psList linked list object.
