aboutsummaryrefslogtreecommitdiff
path: root/inc/lib
diff options
context:
space:
mode:
authorMarvin Borner2023-06-06 00:21:09 +0200
committerMarvin Borner2023-06-06 00:21:09 +0200
commit1337d6e1fa1644974c734cf738575c6a9755c5ef (patch)
treeefed2e0f42168615d475f977187a0e5c7cf54b32 /inc/lib
parentc9b0537a1f04c8a28e1f9aa9a6112a1e59653eea (diff)
Fixed some use-after-frees
Diffstat (limited to 'inc/lib')
-rw-r--r--inc/lib/pqueue.h10
1 files changed, 9 insertions, 1 deletions
diff --git a/inc/lib/pqueue.h b/inc/lib/pqueue.h
index 732002e..02988ce 100644
--- a/inc/lib/pqueue.h
+++ b/inc/lib/pqueue.h
@@ -105,7 +105,7 @@ size_t pqueue_size(struct pqueue *q);
int pqueue_insert(struct pqueue *q, void *d);
/**
- * move an existing entry to a different priority
+ * move an existing entry to a different priority.
* @param q the queue
* @param new_pri the new priority
* @param d the entry
@@ -113,6 +113,14 @@ int pqueue_insert(struct pqueue *q, void *d);
void pqueue_change_priority(struct pqueue *q, pqueue_pri_t new_pri, void *d);
/**
+ * remove an item from the queue.
+ * @param q the queue
+ * @param d the item
+ * @return 0 on success
+ */
+int pqueue_remove(struct pqueue *q, void *d);
+
+/**
* pop the highest-ranking item from the queue.
* @param q the queue
* @return NULL on error, otherwise the entry