Mercurial > cgi-bin > hgwebdir.cgi > VMS > C_Libraries > PriorityQueue
view PriorityQueue.h @ 11:0de14128ff68
comments added for Stefan, and formatting changes
| author | Sean <seanhalle@yahoo.com> |
|---|---|
| date | Thu, 17 May 2012 20:35:19 +0200 |
| parents | 40cad2a2fffc |
| children |
line source
1 /*
2 * Copyright 2009 OpenSourceStewardshipFoundation.org
3 * Licensed under GNU General Public License version 2
4 *
5 * Author: hausers@cs.tu-berlin.de
6 */
8 #ifndef _PRIORITY_QUEUE_H
9 #define _PRIORITY_QUEUE_H
11 #include <stdbool.h>
12 #include <stdio.h>
14 #include "VMS_impl/Services_Offered_by_VMS/Memory_Handling/vmalloc.h"
16 typedef struct _PrioQueueStruc PrioQueueStruc;
17 typedef struct _heapNode heapNode;
19 struct _heapNode {
20 int key;
21 void *val;
22 };
24 struct _PrioQueueStruc {
25 int size;
26 int maxSize;
28 heapNode *data;
29 };
31 PrioQueueStruc* makePrioQ();
32 void* getFirstPrioQ (PrioQueueStruc *Q);
33 void* popPrioQ (PrioQueueStruc *Q);
34 bool insertPrioQ (void *val, int key, PrioQueueStruc *Q);
35 void freePrioQ (PrioQueueStruc *Q);
36 void removePrioQ (int key, PrioQueueStruc *Q);
38 #ifdef DEBUG
39 void printPrioQ (PrioQueueStruc *Q);
40 void swap (PrioQueueStruc *Q, int a, int b);
41 #endif
44 #endif
