Mercurial > cgi-bin > hgwebdir.cgi > VMS > C_Libraries > PriorityQueue
view PriorityQueue.h @ 4:7254bef12749
removed "VMS" from function names -- names compatible with pure C version
| author | Me@portablequad |
|---|---|
| date | Sat, 11 Feb 2012 20:29:34 -0800 |
| parents | b0195491f167 |
| children | 40cad2a2fffc |
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 "../../VMS_Implementations/VMS_impl/VMS_primitive_data_types.h"
15 typedef struct _PrioQueueStruc PrioQueueStruc;
16 typedef struct _heapNode heapNode;
18 struct _heapNode {
19 int key;
20 void *val;
21 };
23 struct _PrioQueueStruc {
24 int size;
25 int maxSize;
27 heapNode *data;
28 };
30 PrioQueueStruc* makePrioQ();
31 void* getFirstPrioQ (PrioQueueStruc *Q);
32 void* popPrioQ (PrioQueueStruc *Q);
33 bool insertPrioQ (void *val, int key, PrioQueueStruc *Q);
34 void freePrioQ (PrioQueueStruc *Q);
36 #ifdef DEBUG
37 void printPrioQ (PrioQueueStruc *Q);
38 void swap (PrioQueueStruc *Q, int a, int b);
39 #endif
42 #endif
