Mercurial > cgi-bin > hgwebdir.cgi > VMS > C_Libraries > PriorityQueue
annotate PriorityQueue.h @ 5:09e51191078a
updated for VMS name chgs from VMS__malloc to VMS_int__malloc
| author | Me@portablequad |
|---|---|
| date | Sun, 12 Feb 2012 01:45:04 -0800 |
| parents | b0195491f167 |
| children | 40cad2a2fffc |
| 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> |
| hausers@0 | 12 |
| Me@2 | 13 #include "../../VMS_Implementations/VMS_impl/VMS_primitive_data_types.h" |
| Me@2 | 14 |
| hausers@0 | 15 typedef struct _PrioQueueStruc PrioQueueStruc; |
| hausers@0 | 16 typedef struct _heapNode heapNode; |
| hausers@0 | 17 |
| hausers@0 | 18 struct _heapNode { |
| hausers@0 | 19 int key; |
| hausers@0 | 20 void *val; |
| hausers@0 | 21 }; |
| hausers@0 | 22 |
| hausers@0 | 23 struct _PrioQueueStruc { |
| hausers@0 | 24 int size; |
| hausers@0 | 25 int maxSize; |
| hausers@0 | 26 |
| hausers@0 | 27 heapNode *data; |
| hausers@0 | 28 }; |
| hausers@0 | 29 |
| Me@4 | 30 PrioQueueStruc* makePrioQ(); |
| hausers@0 | 31 void* getFirstPrioQ (PrioQueueStruc *Q); |
| hausers@0 | 32 void* popPrioQ (PrioQueueStruc *Q); |
| hausers@0 | 33 bool insertPrioQ (void *val, int key, PrioQueueStruc *Q); |
| hausers@0 | 34 void freePrioQ (PrioQueueStruc *Q); |
| hausers@0 | 35 |
| hausers@0 | 36 #ifdef DEBUG |
| hausers@0 | 37 void printPrioQ (PrioQueueStruc *Q); |
| hausers@0 | 38 void swap (PrioQueueStruc *Q, int a, int b); |
| hausers@0 | 39 #endif |
| hausers@0 | 40 |
| hausers@0 | 41 |
| hausers@0 | 42 #endif |
| hausers@0 | 43 |
