1 /* SPDX-License-Identifier: LGPL-2.1+ */
5 This file is part of systemd.
7 Copyright 2013 Lennart Poettering
15 typedef struct Prioq Prioq;
17 #define PRIOQ_IDX_NULL ((unsigned) -1)
19 Prioq *prioq_new(compare_func_t compare);
20 Prioq *prioq_free(Prioq *q);
21 int prioq_ensure_allocated(Prioq **q, compare_func_t compare_func);
23 int prioq_put(Prioq *q, void *data, unsigned *idx);
24 int prioq_remove(Prioq *q, void *data, unsigned *idx);
25 int prioq_reshuffle(Prioq *q, void *data, unsigned *idx);
27 void *prioq_peek(Prioq *q) _pure_;
28 void *prioq_pop(Prioq *q);
30 unsigned prioq_size(Prioq *q) _pure_;
31 bool prioq_isempty(Prioq *q) _pure_;