Mercurial > cgi-bin > hgwebdir.cgi > VMS > C_Libraries > PriorityQueue
view PriorityQueue.h @ 3:500d0e2fabfb
made pure C and added .brch__defaul and eol handling
| author | Me@portablequad |
|---|---|
| date | Sat, 11 Feb 2012 20:27:13 -0800 |
| parents | 9ecc993a29ea |
| 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>
13 #include <limits.h>
14 #include <stdio.h>
15 #include <string.h>
17 typedef struct _PrioQueueStruc PrioQueueStruc;
18 typedef struct _heapNode heapNode;
20 struct _heapNode {
21 int key;
22 void *val;
23 };
25 struct _PrioQueueStruc {
26 int size;
27 int maxSize;
29 heapNode *data;
30 };
32 PrioQueueStruc* makePrioQ();
33 void* getFirstPrioQ (PrioQueueStruc *Q);
34 void* popPrioQ (PrioQueueStruc *Q);
35 bool insertPrioQ (void *val, int key, PrioQueueStruc *Q);
36 void freePrioQ (PrioQueueStruc *Q);
38 #ifdef DEBUG
39 void printPrioQ (PrioQueueStruc *Q);
40 void swap (PrioQueueStruc *Q, int a, int b);
41 #endif
44 #endif
