Reorganize code into library for reuse

This commit is contained in:
2021-05-08 15:58:59 -04:00
parent d1f144aca7
commit aa4d8efdd2
20 changed files with 140 additions and 75 deletions

15
lib/pq.h Normal file
View File

@@ -0,0 +1,15 @@
#ifndef _PQ_H
#define _PQ_H 1
#include <stdbool.h>
#include "grid.h"
struct pq;
struct pq* pq_new(size_t heap_size);
void pq_add(struct pq* q, unsigned int priority, size_t x, size_t y, mazeedge_dir_t dir);
int pq_pop(struct pq* q, size_t* x, size_t* y, mazeedge_dir_t *dir);
bool pq_empty(struct pq const* q);
void pq_free(struct pq* q);
#endif // !def(_PQ_H)