summaryrefslogtreecommitdiff
path: root/src/kdtree.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/kdtree.h')
-rw-r--r--src/kdtree.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/kdtree.h b/src/kdtree.h
index 8969533..e121442 100644
--- a/src/kdtree.h
+++ b/src/kdtree.h
@@ -1,3 +1,6 @@
+#include <stdio.h>
+#include <stdlib.h>
+
typedef struct KDTree {
unsigned int x;
unsigned int y;
@@ -19,3 +22,12 @@ void kdtree_free(kdtree_t **root);
//! in order walk of nodes in kdtree
void kdtree_walk(kdtree_t *root, void (* consume)(kdtree_t*));
+//! get number of nodes in a kdtree
+int kdtree_size(kdtree_t *root);
+
+//! write tree to a file
+int kdtree_fwrite(kdtree_t *root, FILE *file);
+
+//! read a tree from file
+int kdtree_fread(kdtree_t **root, FILE *file);
+