Index: trunk/Ohana/src/opihi/cmd.data/Makefile
===================================================================
--- trunk/Ohana/src/opihi/cmd.data/Makefile	(revision 8131)
+++ trunk/Ohana/src/opihi/cmd.data/Makefile	(revision 8177)
@@ -75,4 +75,6 @@
 $(SDIR)/point.$(ARCH).o		\
 $(SDIR)/ps.$(ARCH).o		\
+$(SDIR)/queuedelete.$(ARCH).o	\
+$(SDIR)/queuedrop.$(ARCH).o	\
 $(SDIR)/queuelist.$(ARCH).o	\
 $(SDIR)/queuesize.$(ARCH).o	\
@@ -81,5 +83,4 @@
 $(SDIR)/queueprint.$(ARCH).o	\
 $(SDIR)/queueinit.$(ARCH).o	\
-$(SDIR)/queuedelete.$(ARCH).o	\
 $(SDIR)/radial.$(ARCH).o	\
 $(SDIR)/rd.$(ARCH).o		\
Index: trunk/Ohana/src/opihi/cmd.data/init.c
===================================================================
--- trunk/Ohana/src/opihi/cmd.data/init.c	(revision 8131)
+++ trunk/Ohana/src/opihi/cmd.data/init.c	(revision 8177)
@@ -63,4 +63,5 @@
 int queueinit        PROTO((int, char **));
 int queuedelete      PROTO((int, char **));
+int queuedrop        PROTO((int, char **));
 int queuepop         PROTO((int, char **));
 int queueprint       PROTO((int, char **));
@@ -171,4 +172,5 @@
   {"ps",      	   ps,		     "define labels for plot"},
   {"queuepop", 	   queuepop,	     "pop value from queue to variable"},
+  {"queuedrop",    queuedrop,	     "drop values from queue matching a key"},
   {"queueprint",   queueprint,	     "print the contents of a queue"},
   {"queuepush",	   queuepush,	     "push value onto queue"},
Index: trunk/Ohana/src/opihi/cmd.data/queuedrop.c
===================================================================
--- trunk/Ohana/src/opihi/cmd.data/queuedrop.c	(revision 8177)
+++ trunk/Ohana/src/opihi/cmd.data/queuedrop.c	(revision 8177)
@@ -0,0 +1,39 @@
+# include "data.h"
+
+int queuedrop (int argc, char **argv) {
+  
+  int N, Key;
+  char *var;
+  char *line;
+  char *Value;
+  Queue *queue;
+
+  Key = -1;
+  if ((N = get_argument (argc, argv, "-key"))) {
+    remove_argument (N, &argc, argv);
+    Key = atoi (argv[N]);
+    remove_argument (N, &argc, argv);
+    Value = strcreate (argv[N]);
+    remove_argument (N, &argc, argv);
+  }
+
+
+  if ((argc != 2) || (Key == -1)) {
+    gprint (GP_ERR, "USAGE: queuedrop (queue) [-key N value]\n");
+    return (FALSE);
+  }
+
+  /* will create a queue if none exists */
+  queue = FindQueue (argv[1]);
+  if (queue == NULL) {
+    gprint (GP_ERR, "ERROR: queue %s not found\n", argv[1]);
+    return (FALSE);
+  }
+
+  /* drop all matching entries, if any exist */
+  while ((line = PopQueueMatch (queue, Key, Value)) != NULL) {
+    free (line);
+  }
+  return (TRUE);
+}
+
