4 * \brief Prototypes for heap routines.
6 * This file, heap.h, was written and is
8 * Copyright (c) 2001 C. Scott Ananian
12 * <h1><b>Copyright.</b></h1>\n
14 * PCB, interactive printed circuit board design
16 * Copyright (C) 1994,1995,1996 Thomas Nau
18 * Copyright (C) 1998,1999,2000,2001 harry eaton
20 * This program is free software; you can redistribute it and/or modify
21 * it under the terms of the GNU General Public License as published by
22 * the Free Software Foundation; either version 2 of the License, or
23 * (at your option) any later version.
25 * This program is distributed in the hope that it will be useful,
26 * but WITHOUT ANY WARRANTY; without even the implied warranty of
27 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
28 * GNU General Public License for more details.
30 * You should have received a copy of the GNU General Public License
31 * along with this program; if not, write to the Free Software
32 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
34 * Contact addresses for paper mail and Email:
35 * harry eaton, 6697 Buttonhole Ct, Columbia, MD 21044 USA
36 * haceaton@aplcomm.jhuapl.edu
45 * \brief Type of heap costs.
47 typedef double cost_t
;
49 * \brief What a heap looks like.
51 typedef struct heap_struct heap_t
;
53 heap_t
*heap_create ();
54 void heap_destroy (heap_t
** heap
);
55 void heap_free (heap_t
* heap
, void (*funcfree
) (void *));
58 void heap_insert (heap_t
* heap
, cost_t cost
, void *data
);
59 void *heap_remove_smallest (heap_t
* heap
);
60 void *heap_replace (heap_t
* heap
, cost_t cost
, void *data
);
62 /* -- interrogation -- */
63 int heap_is_empty (heap_t
* heap
);
64 int heap_size (heap_t
* heap
);
66 #endif /* PCB_HEAP_H */