Mercurial > cgi-bin > hgwebdir.cgi > VMS > C_Libraries > PriorityQueue
annotate 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 |
| rev | line source |
|---|---|
| hausers@0 | 1 /* |
| hausers@0 | 2 * Copyright 2009 OpenSourceStewardshipFoundation.org |
| hausers@0 | 3 * Licensed under GNU General Public License version 2 |
| hausers@0 | 4 * |
| hausers@0 | 5 * Author: hausers@cs.tu-berlin.de |
| hausers@0 | 6 */ |
| hausers@0 | 7 |
| hausers@0 | 8 #ifndef _PRIORITY_QUEUE_H |
| hausers@0 | 9 #define _PRIORITY_QUEUE_H |
| hausers@0 | 10 |
| hausers@0 | 11 #include <stdbool.h> |
| seanhalle@10 | 12 #include <stdio.h> |
| hausers@0 | 13 |
| seanhalle@10 | 14 #include "VMS_impl/Services_Offered_by_VMS/Memory_Handling/vmalloc.h" |
| Me@2 | 15 |
| hausers@0 | 16 typedef struct _PrioQueueStruc PrioQueueStruc; |
| hausers@0 | 17 typedef struct _heapNode heapNode; |
| hausers@0 | 18 |
| hausers@0 | 19 struct _heapNode { |
| hausers@0 | 20 int key; |
| hausers@0 | 21 void *val; |
| hausers@0 | 22 }; |
| hausers@0 | 23 |
| hausers@0 | 24 struct _PrioQueueStruc { |
| hausers@0 | 25 int size; |
| hausers@0 | 26 int maxSize; |
| hausers@0 | 27 |
| hausers@0 | 28 heapNode *data; |
| hausers@0 | 29 }; |
| hausers@0 | 30 |
| Me@4 | 31 PrioQueueStruc* makePrioQ(); |
| hausers@0 | 32 void* getFirstPrioQ (PrioQueueStruc *Q); |
| hausers@0 | 33 void* popPrioQ (PrioQueueStruc *Q); |
| hausers@0 | 34 bool insertPrioQ (void *val, int key, PrioQueueStruc *Q); |
| hausers@0 | 35 void freePrioQ (PrioQueueStruc *Q); |
| hausers@9 | 36 void removePrioQ (int key, PrioQueueStruc *Q); |
| hausers@0 | 37 |
| hausers@0 | 38 #ifdef DEBUG |
| hausers@0 | 39 void printPrioQ (PrioQueueStruc *Q); |
| hausers@0 | 40 void swap (PrioQueueStruc *Q, int a, int b); |
| hausers@0 | 41 #endif |
| hausers@0 | 42 |
| hausers@0 | 43 |
| hausers@0 | 44 #endif |
| hausers@0 | 45 |
