From c3c07f28dcd226975b5ed0c1f8842f51968a3288 Mon Sep 17 00:00:00 2001 From: hasso Date: Mon, 21 Feb 2005 18:17:52 +0000 Subject: * pqueue.[ch]: Introduce "update" function to meet ospf spf needs. It will allow to update node when: i) a node is inserted into the priority queue; ii) a node position is modified in the priority queue; * pqueue.h: Export trickle_down() function. --- lib/pqueue.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'lib/pqueue.h') diff --git a/lib/pqueue.h b/lib/pqueue.h index 95f79b8c..d19c46de 100644 --- a/lib/pqueue.h +++ b/lib/pqueue.h @@ -28,6 +28,7 @@ struct pqueue int size; int (*cmp) (void *, void *); + void (*update) (void * node, int actual_position); }; #define PQUEUE_INIT_ARRAYSIZE 32 @@ -38,4 +39,6 @@ void pqueue_delete (struct pqueue *queue); void pqueue_enqueue (void *data, struct pqueue *queue); void *pqueue_dequeue (struct pqueue *queue); +void trickle_down (int index, struct pqueue *queue); + #endif /* _ZEBRA_PQUEUE_H */ -- cgit v1.2.1