GLAST/LAT > DAQ and FSW > FSW > Doxygen Index > LDT / V0-4-0

Constituent: encdec     Tag: rad750


Interface   Data Structures   File List   Data Fields   Globals  

HEAP.c File Reference

HEAP, implementation file. More...

#include <stdlib.h>
#include "LDT/HEAP.h"

Include dependency graph for HEAP.c:


Functions

void HEAP_init (HEAP *heap, HEAP_compare compare, HEAP_destroy destroy)
 Initializes a heap for use.
void HEAP_free (HEAP *heap)
 Frees all the nodes of the heap.
int HEAP_insert (HEAP *heap, const void *data)
 Inserts a node with the specified data on the heap.
int HEAP_extract (HEAP *heap, void **data)
 Extracts (removes) the top node of the heap.

Detailed Description

HEAP, implementation file.

Author:
JJRussell - russell@slac.stanford.edu

CVS $Id

Warning:
In their current state, these routines are not fit for Flight use. They can be used in studies. However they malloc all over the place and involve recursive calling techniques, neither of is appropriate for Flight code.

Function Documentation

int HEAP_extract ( HEAP heap,
void **  data 
)

Extracts (removes) the top node of the heap.

Returns:
Status
Parameters:
heap The heap to remove the node from
data Returned as a pointer to the data associated with the node
The return value is -1 if the heap is empty or an internal error occurs.

HEAP_free ( HEAP heap  ) 

Frees all the nodes of the heap.

Parameters:
heap The heap to free

void HEAP_init ( HEAP heap,
HEAP_compare  compare,
HEAP_destroy  destroy 
)

Initializes a heap for use.

Parameters:
heap The heap control structure to initialize
compare Callback comparision routine
destroy Callback destruction (free) routine

int HEAP_insert ( HEAP heap,
const void *  data 
)

Inserts a node with the specified data on the heap.

Returns:
Status
Parameters:
heap The heap to insert the node on
data The data
The only reason for failure is if the heap is specified as NULL


Generated on Fri Jun 19 01:48:12 2009 by  doxygen 1.5.3