59#error Must define a SPECPQ_TAG to use this header
61#ifndef SPECPQ_PRIORITY_TYPE
62#error Must define a SPECPQ_PRIORITY_TYPE to use this header
64#ifndef SPECPQ_DATA_TYPE
65#error Must define a SPECPQ_DATA_TYPE to use this header
68#define SPECPQ_PASTE_(x, y) x ## y
69#define SPECPQ_PASTE(x, y) SPECPQ_PASTE_(x, y)
71#define SPECPQ_PQ struct SPECPQ_PASTE(SPECPQ_TAG, _pq)
72#define SPECPQ_PQ_ struct SPECPQ_PASTE(SPECPQ_TAG, _pq_private_)
73#define SPECPQ_CELL_ struct SPECPQ_PASTE(SPECPQ_TAG, _cell_private_)
74#define SPECPQ_FOO(suffix) SPECPQ_PASTE(SPECPQ_TAG, suffix)
136 for (
i = 1;
i <
pq->size;
i++) {
155 if (
pq->size >=
pq->avail) {
164 while (
i > 1 && (j =
i / 2) &&
pq->cells[j].priority <
priority) {
165 pq->cells[
i] =
pq->cells[j];
168 pq->cells[
i].data = data;
183 for (
i =
pq->size - 1;
i >= 1;
i--) {
184 if (
pq->cells[
i].data == data) {
194 while ((j =
i / 2) &&
pq->cells[j].priority <
priority) {
195 pq->cells[
i] =
pq->cells[j];
198 pq->cells[
i].data = data;
222 top =
pq->cells[1].data;
286#undef SPECPQ_PRIORITY_TYPE
287#undef SPECPQ_DATA_TYPE
#define fc_assert_ret_val(condition, val)
#define fc_realloc(ptr, sz)
#define SPECPQ_PRIORITY_TYPE
#define SPECPQ_FOO(suffix)
static void SPECPQ_FOO() _pq_insert(SPECPQ_PQ *_pq, SPECPQ_DATA_TYPE data, SPECPQ_PRIORITY_TYPE priority)
static void SPECPQ_FOO() _pq_replace(SPECPQ_PQ *_pq, SPECPQ_DATA_TYPE data, SPECPQ_PRIORITY_TYPE priority)
static void SPECPQ_FOO() _pq_destroy(SPECPQ_PQ *_pq)
static bool SPECPQ_FOO() _pq_peek(const SPECPQ_PQ *_pq, SPECPQ_DATA_TYPE *pdata)
static void SPECPQ_FOO() _pq_destroy_full(SPECPQ_PQ *_pq, SPECPQ_FOO(_pq_data_free_fn_t) data_free)
SPECPQ_PRIORITY_TYPE priority
static SPECPQ_PQ *SPECPQ_FOO() _pq_new(int initial_size)
static bool SPECPQ_FOO() _pq_remove(SPECPQ_PQ *_pq, SPECPQ_DATA_TYPE *pdata)
static bool SPECPQ_FOO() _pq_priority(const SPECPQ_PQ *_pq, SPECPQ_PRIORITY_TYPE *ppriority)