vaseboot/include/VasEBoot/priority_queue.h

45 lines
1.5 KiB
C

/*
* VasEBoot -- GRand Unified Bootloader
* Copyright (C) 2011 Free Software Foundation, Inc.
*
* VasEBoot is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* VasEBoot is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with VasEBoot. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef VasEBoot_PRIORITY_QUEUE_HEADER
#define VasEBoot_PRIORITY_QUEUE_HEADER 1
#include <VasEBoot/misc.h>
#include <VasEBoot/err.h>
#ifdef __cplusplus
extern "C" {
#endif
struct VasEBoot_priority_queue;
typedef struct VasEBoot_priority_queue *VasEBoot_priority_queue_t;
typedef int (*VasEBoot_comparator_t) (const void *a, const void *b);
VasEBoot_priority_queue_t VasEBoot_priority_queue_new (VasEBoot_size_t elsize,
VasEBoot_comparator_t cmp);
void VasEBoot_priority_queue_destroy (VasEBoot_priority_queue_t pq);
void *VasEBoot_priority_queue_top (VasEBoot_priority_queue_t pq);
void VasEBoot_priority_queue_pop (VasEBoot_priority_queue_t pq);
VasEBoot_err_t VasEBoot_priority_queue_push (VasEBoot_priority_queue_t pq, const void *el);
#ifdef __cplusplus
}
#endif
#endif