Mercurial > cgi-bin > hgwebdir.cgi > VMS > C_Libraries > PriorityQueue
annotate 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 |
| 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@3 | 13 #include <limits.h> |
| Me@3 | 14 #include <stdio.h> |
| Me@3 | 15 #include <string.h> |
| Me@3 | 16 |
| hausers@0 | 17 typedef struct _PrioQueueStruc PrioQueueStruc; |
| hausers@0 | 18 typedef struct _heapNode heapNode; |
| hausers@0 | 19 |
| hausers@0 | 20 struct _heapNode { |
| hausers@0 | 21 int key; |
| hausers@0 | 22 void *val; |
| hausers@0 | 23 }; |
| hausers@0 | 24 |
| hausers@0 | 25 struct _PrioQueueStruc { |
| hausers@0 | 26 int size; |
| hausers@0 | 27 int maxSize; |
| hausers@0 | 28 |
| hausers@0 | 29 heapNode *data; |
| hausers@0 | 30 }; |
| hausers@0 | 31 |
| Me@3 | 32 PrioQueueStruc* makePrioQ(); |
| hausers@0 | 33 void* getFirstPrioQ (PrioQueueStruc *Q); |
| hausers@0 | 34 void* popPrioQ (PrioQueueStruc *Q); |
| hausers@0 | 35 bool insertPrioQ (void *val, int key, PrioQueueStruc *Q); |
| hausers@0 | 36 void freePrioQ (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 |
