Index: /trunk/psLib/src/types/psList.c
===================================================================
--- /trunk/psLib/src/types/psList.c	(revision 18824)
+++ /trunk/psLib/src/types/psList.c	(revision 18825)
@@ -7,6 +7,6 @@
  *  @author Joshua Hoblitt, University of Hawaii
  *
- *  @version $Revision: 1.69 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2008-05-05 00:09:04 $
+ *  @version $Revision: 1.70 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2008-07-31 23:41:04 $
  *
  *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
@@ -437,4 +437,5 @@
     PS_ASSERT_LIST_NON_NULL(list, NULL);
 
+    // XXX this should not be an error, right?
     if (list->head == NULL) { // list empty?
         psError(PS_ERR_BAD_PARAMETER_NULL, true,
@@ -453,4 +454,19 @@
 
     return iterator->cursor->data;
+}
+
+// simultaneous get and remove (ie, 'pop')
+psPtr psListGetAndRemove (psList *list, long location) {
+
+    PS_ASSERT_LIST_NON_NULL(list, NULL);
+
+    // empty list : 
+    // XXX handle this explicitly since psListGet raises an error in this case
+    if (list->head == NULL) return NULL;
+
+    psPtr *item = psListGet (list, location);
+
+    psListRemove (list, location);
+    return item;
 }
 
Index: /trunk/psLib/src/types/psList.h
===================================================================
--- /trunk/psLib/src/types/psList.h	(revision 18824)
+++ /trunk/psLib/src/types/psList.h	(revision 18825)
@@ -5,6 +5,6 @@
  *  @author Robert Daniel DeSonia, MHPCC
  *
- *  @version $Revision: 1.46 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2007-08-09 01:40:08 $
+ *  @version $Revision: 1.47 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2008-07-31 23:41:04 $
  *
  *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
@@ -208,4 +208,15 @@
 );
 
+/** Retrieve an item from a list.
+ *
+ *  @return psPtr       the item corresponding to the location parameter.  If
+ *                      location is invalid (e.g., a numbered index greater
+ *                      than the list size or if the list is empty), a
+ *                      NULL is returned.
+ */
+psPtr psListGetAndRemove (
+    psList *list, 			///< list from which to get and remove the element
+    long location			///< index of item
+);
 
 /** Position the specified iterator to the next item in list.
