heap.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.


struct  _heap_node
struct  _heap


#define heap_gen_key(hp, md)   ((hp)->gen_key((md),(hp)->age))
#define heap_nodes(heap)   ((heap)->last)
#define heap_empty(heap)   ((heap)->last <= 0 ? 1 : 0)


typedef unsigned long heap_mutex_t
typedef void * heap_t
typedef double heap_key
typedef heap_key heap_key_func (heap_t, heap_key)
typedef struct _heap_node heap_node
typedef struct _heap heap


SQUIDCEXTERN heapnew_heap (int init_size, heap_key_func gen_key)
SQUIDCEXTERN void delete_heap (heap *)
SQUIDCEXTERN heap_nodeheap_insert (heap *hp, heap_t dat)
SQUIDCEXTERN heap_t heap_delete (heap *, heap_node *elm)
SQUIDCEXTERN heap_t heap_update (heap *, heap_node *elm, heap_t dat)
SQUIDCEXTERN heap_t heap_extractmin (heap *)
SQUIDCEXTERN heap_t heap_extractlast (heap *hp)
SQUIDCEXTERN heap_key heap_peepminkey (heap *)
SQUIDCEXTERN heap_key heap_peepkey (heap *, int n)
SQUIDCEXTERN heap_t heap_peepmin (heap *)
SQUIDCEXTERN heap_t heap_peep (heap *, int n)
SQUIDCEXTERN void heap_print (heap *)
SQUIDCEXTERN void heap_printnode (char *msg, heap_node *elm)
SQUIDCEXTERN int verify_heap_property (heap *)

Macro Definition Documentation

#define heap_empty (   heap)    ((heap)->last <= 0 ? 1 : 0)

Definition at line 142 of file heap.h.

#define heap_gen_key (   hp,
)    ((hp)->gen_key((md),(hp)->age))

Definition at line 105 of file heap.h.

#define heap_nodes (   heap)    ((heap)->last)

Definition at line 141 of file heap.h.

Typedef Documentation

typedef struct _heap heap
typedef double heap_key

Definition at line 33 of file heap.h.

typedef heap_key heap_key_func(heap_t, heap_key)

Definition at line 34 of file heap.h.

typedef unsigned long heap_mutex_t

Definition at line 31 of file heap.h.

typedef struct _heap_node heap_node
typedef void* heap_t

Definition at line 32 of file heap.h.

Function Documentation

SQUIDCEXTERN void delete_heap ( heap )

Definition at line 95 of file heap.c.

References assert, i, _heap::last, _heap::nodes, NULL, and xfree.

SQUIDCEXTERN heap_t heap_extractlast ( heap hp)

Definition at line 210 of file heap.c.

References _heap_node_exist(), assert, data, _heap_node::data, _heap::last, _heap::nodes, and xfree.

Referenced by heap_delete().

SQUIDCEXTERN heap_t heap_extractmin ( heap )

Definition at line 188 of file heap.c.

References data, _heap_node::data, heap_delete(), _heap::last, _heap::lock, mutex_lock, mutex_unlock, _heap::nodes, and NULL.

Referenced by heap_purgeNext().

SQUIDCEXTERN heap_t heap_peep ( heap ,
int  n 

Definition at line 281 of file heap.c.

References _heap_node_exist(), assert, data, _heap_node::data, and _heap::nodes.

Referenced by heap_walkNext().

SQUIDCEXTERN heap_key heap_peepkey ( heap ,
int  n 

Definition at line 268 of file heap.c.

References _heap_node_exist(), assert, _heap_node::key, and _heap::nodes.

SQUIDCEXTERN heap_t heap_peepmin ( heap )

Definition at line 247 of file heap.c.

References _heap_node_exist(), assert, _heap_node::data, and _heap::nodes.

SQUIDCEXTERN heap_key heap_peepminkey ( heap )

Definition at line 257 of file heap.c.

References _heap_node_exist(), assert, _heap_node::key, and _heap::nodes.

Referenced by heap_purgeNext().

SQUIDCEXTERN void heap_print ( heap )
SQUIDCEXTERN void heap_printnode ( char *  msg,
heap_node elm 
SQUIDCEXTERN heap_t heap_update ( heap ,
heap_node elm,
heap_t  dat 
SQUIDCEXTERN heap* new_heap ( int  init_size,
heap_key_func  gen_key 

Definition at line 72 of file heap.c.

References _heap::age, assert, _heap::gen_key, _heap::last, MinSize, _heap::nodes, NULL, _heap::size, xcalloc, and xmalloc.

Referenced by createRemovalPolicy_heap().

SQUIDCEXTERN int verify_heap_property ( heap )






Web Site Translations