1 
2 /****************************************************************************
3  ****************************************************************************
4 
5 	File   : heap.h
6 	Author : Ted Stanion
7 	Date   : Mon Apr 30 22:36:17 1990
8 
9 	Abstract : Include file for heap.c
10 
11 	Revisions :
12 
13 	Futures :
14 
15  ****************************************************************************
16  ****************************************************************************/
17 
18 #ifndef HEAP_H
19 #define HEAP_H
20 
21 
22 #include <yalecad/base.h>
23 
24 /****************************************************************************
25 
26 	Structure : heap
27 	Author    : Ted Stanion
28 	Date      : Mon Apr 30 22:57:04 1990
29 
30 	Abstract : Top level data structure for heaps.
31 
32 *****************************************************************************/
33 
34 typedef struct heap {
35   INT (*heap_cmp)();
36   struct heap_el *top;
37 } YHEAP, *YHEAPPTR;
38 
39 
40 /****************************************************************************
41 
42 	Macro  : heap_empty
43 	Author : Ted Stanion
44 	Date   : Tue May  1 16:40:02 1990
45 
46 	Abstract : Returns TRUE if the heap is empty.
47 
48 *****************************************************************************/
49 
50 #define heap_empty(h) (((h)->top) ? FALSE : TRUE)
51 
52 
53 /************************************************************************
54  *  									*
55  *  Global Functions							*
56  *  									*
57  ************************************************************************/
58 
59 extern YHEAPPTR Yheap_init();
60 extern YHEAPPTR Yheap_init_with_parms(P1(INT (*fn)()));
61 extern VOID Yheap_empty(P1(YHEAPPTR));
62 extern VOID Yheap_free(P1(YHEAPPTR));
63 extern VOID Yheap_insert(P2(YHEAPPTR, VOIDPTR));
64 extern VOIDPTR Yheap_delete_min(P1(YHEAPPTR));
65 extern VOIDPTR Yheap_top(P1(YHEAPPTR));
66 extern YHEAPPTR Yheap_meld(P2(YHEAPPTR, YHEAPPTR));
67 extern INT Yheap_cmp_num(P2(INT, INT));
68 extern INT Yheap_cmp_ptr(P2(VOIDPTR, VOIDPTR));
69 extern VOID Yheap_check_mem();
70 extern INT Yheap_verify(P1(YHEAPPTR));
71 
72 #endif
73