pque.h 306 B

123456789101112131415161718
  1. #ifndef PQUEUE_H_
  2. #define PQUEUE_H_
  3. typedef struct {
  4. void *buf;
  5. int elemsz;
  6. int cap;
  7. int size;
  8. int (*cmp)(void*, void*);
  9. } PQue;
  10. void pq_init(PQue *pq, int cap, int elemsz, int (*cmp)(void*, void*));
  11. void pq_push(PQue *pq, void *elem);
  12. void pq_pop(PQue *pq);
  13. void* pq_top();
  14. #endif