aboutsummaryrefslogtreecommitdiff
path: root/advent-of-code/2022/lib/pque.h
blob: 0d8656065dee4b7d3a1f0cc77236ab4c2e0f4624 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#ifndef PQUEUE_H_
#define PQUEUE_H_

typedef struct {
    void *buf;
    int elemsz;
    int cap;
    int size;
    int (*cmp)(void*, void*);
} PQue;

void pq_init(PQue *pq, int cap, int elemsz, int (*cmp)(void*, void*));
void pq_push(PQue *pq, void *elem);
void pq_pop(PQue *pq);
void* pq_top();

#endif