File: heap.h

package info (click to toggle)
graywolf 0.1.6-4
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye
  • size: 6,424 kB
  • sloc: ansic: 84,358; sh: 216; awk: 36; makefile: 22
file content (72 lines) | stat: -rw-r--r-- 1,956 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72

/****************************************************************************
 ****************************************************************************

	File   : heap.h
	Author : Ted Stanion
	Date   : Mon Apr 30 22:36:17 1990

	Abstract : Include file for heap.c

	Revisions :

	Futures : 

 ****************************************************************************
 ****************************************************************************/

#ifndef HEAP_H
#define HEAP_H


#include <yalecad/base.h>

/****************************************************************************

	Structure : heap
	Author    : Ted Stanion
	Date      : Mon Apr 30 22:57:04 1990

	Abstract : Top level data structure for heaps.

*****************************************************************************/

typedef struct heap {
  INT (*heap_cmp)();
  struct heap_el *top;
} YHEAP, *YHEAPPTR;


/****************************************************************************

	Macro  : heap_empty
	Author : Ted Stanion
	Date   : Tue May  1 16:40:02 1990

	Abstract : Returns TRUE if the heap is empty.

*****************************************************************************/

#define heap_empty(h) (((h)->top) ? FALSE : TRUE)


/************************************************************************
 *  									*
 *  Global Functions							*
 *  									*
 ************************************************************************/

extern YHEAPPTR Yheap_init();
extern YHEAPPTR Yheap_init_with_parms(P1(INT (*fn)()));
extern VOID Yheap_empty(P1(YHEAPPTR));
extern VOID Yheap_free(P1(YHEAPPTR));
extern VOID Yheap_insert(P2(YHEAPPTR, VOIDPTR));
extern VOIDPTR Yheap_delete_min(P1(YHEAPPTR));
extern VOIDPTR Yheap_top(P1(YHEAPPTR));
extern YHEAPPTR Yheap_meld(P2(YHEAPPTR, YHEAPPTR));
extern INT Yheap_cmp_num(P2(INT, INT));
extern INT Yheap_cmp_ptr(P2(VOIDPTR, VOIDPTR));
extern VOID Yheap_check_mem();
extern INT Yheap_verify(P1(YHEAPPTR));

#endif