Index: /trunk/archive/pslib/include/psList.h
===================================================================
--- /trunk/archive/pslib/include/psList.h	(revision 1579)
+++ /trunk/archive/pslib/include/psList.h	(revision 1580)
@@ -1,6 +1,6 @@
-#if !defined(PS_DLIST_H)
-#define PS_DLIST_H
+#if !defined(PS_LIST_H)
+#define PS_LIST_H
 
-/** \file psDlist.h
+/** \file psList.h
  *  \brief Support for doubly linked lists
  *  \ingroup DataGroup
@@ -8,25 +8,27 @@
 
 /** Doubly-linked list element */
-typedef struct psDlistElem {
-   struct psDlistElem *prev;		///< previous link in list
-   struct psDlistElem *next;		///< next link in list
+typedef struct psListElem {
+   struct psListElem *prev;		///< previous link in list
+   struct psListElem *next;		///< next link in list
    void *data;				///< real data item
-} psDlistElem;
+} psListElem;
 
 /** Doubly-linked list */
 typedef struct {
-   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
-} psDlist;
+   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;
 
 /** Special values of index into list */
 enum {
-   PS_DLIST_HEAD = 0,			///< at head
-   PS_DLIST_TAIL = -1,			///< at tail
-   PS_DLIST_UNKNOWN = -2,		///< unknown position
-   PS_DLIST_PREV = -3,			///< previous element
-   PS_DLIST_NEXT = -4			///< next element
+   PS_LIST_HEAD = 0,			///< at head
+   PS_LIST_TAIL = -1,			///< at tail
+   PS_LIST_UNKNOWN = -2,		///< unknown position
+   PS_LIST_PREV = -3,			///< previous element
+   PS_LIST_NEXT = -4			///< next element
 };
 
@@ -37,9 +39,9 @@
 
 /** Constructor */
-psDlist *psDlistAlloc(void *data)	///< initial data item; may be NULL
+psList *psListAlloc(void *data)		///< initial data item; may be NULL
 ;
 
 /** Destructor */
-void psDlistFree(psDlist *list,		///< list to destroy
+void psListFree(psList *list,		///< list to destroy
 		void (*elemFree)(void *)) ///< destructor for data on list
 ;
@@ -48,53 +50,48 @@
 
 /** Add to list */
-psDlist *psDlistAdd(psDlist *list,	///< list to add to (may be NULL)
-		    void *data,		///< data item to add
-		    int where)		///< index, PS_DLIST_HEAD, or PS_DLIST_TAIL
-;
-
-/** Append to a list */
-psDlist *psDlistAppend(psDlist *list,	///< list to append to (may be NULL)
-		       void *data)	///< data item to add
+bool *psListAdd(psList *list,		///< list to add to (may be NULL)
+		void *data,		///< data item to add
+		int where)		///< index, PS_LIST_HEAD, or PS_LIST_TAIL
 ;
 
 /** Remove from a list */
-void *psDlistRemove(psDlist *list,	///< list to remove element from
-		    void *data,		///< data item to remove
-		    int which)		///< index of item, or PS_DLIST_UNKNOWN, PS_DLIST_NEXT, PS_DLIST_PREV
+bool *psListRemove(psList *list,	///< list to remove element from
+		   void *data,		///< data item to remove
+		   int which)		///< index of item, or PS_LIST_UNKNOWN, PS_LIST_NEXT, PS_LIST_PREV
 ;
 
 /** Retrieve from a list */
-void *psDlistGet(const psDlist *list,	///< list to retrieve element from
-		 int which)		///< index of item, or PS_DLIST_NEXT, PS_DLIST_PREV, PS_DLIST_UNKNOWN
+void *psListGet(const psList *list,	///< list to retrieve element from
+		int which)		///< index of item, or PS_LIST_NEXT, PS_LIST_PREV, PS_LIST_UNKNOWN
 ;
 
+/** Convert doubly-linked list to an array of (void *) */
+psArray *psListToArray(psList *list)	///< List to convert
+;
+
+/** Convert array to a doubly-linked list */
+psList *psArrayToList(psArray *array) ///< array of (void *) to convert
+;
+
+/** Sort a list. */
+psList *psListSort(psList *list,	///< List to sort
+		   int (*compare)(const void **a, const void **b) // Function to compare two list elements
+    );
+
 /** Set the iterator */
-void psDlistSetIterator(psDlist *list,	///< list to retrieve element from
-			int where,	///< index, PS_DLIST_HEAD, or PS_DLIST_TAIL
-			int which)	///< the desired iterator
+void psListSetIterator(psList *list,	///< list to retrieve element from
+		       int where,	///< index, PS_LIST_HEAD, or PS_LIST_TAIL
+		       int which)	///< the desired iterator
 ;
 
 /** Get next element relative to iter */
-void *psDlistGetNext(psDlist *list,	///< list to retrieve element from
-		     int which)		///< the desired iterator
+void *psListGetNext(psList *list,	///< list to retrieve element from
+		    int which)		///< the desired iterator
 ;
 
 /** Get prev element relative to iter */
-void *psDlistGetPrev(psDlist *list,	///< list to retrieve element from
-		     int which)		///< the desired iterator
+void *psListGetPrevious(psList *list,	///< list to retrieve element from
+			int which)	///< the desired iterator
 ;
-
-/** Convert doubly-linked list to a vector of (void *) */
-psVector *psDlistToVector(psDlist *dlist) ///< List to convert
-;
-
-/** Convert array to a doubly-linked list */
-psDlist *psArrayToDlist(psVector *vector) ///< vector of (void *) to convert
-;
-
-/** Sort a list. */
-psDlist *psDlistSort(psDlist *list,	///< List to sort
-		     int (*compare)(const void *a, const void *b) // Function to compare two list elements
-    );
 
 /* \} */ // End of DataGroup Functions
