long int depth; /* The deepest subtree branch */
};
+struct quadtree_ops {
+ int (*compare)(struct quadtree *a, struct quadtree *b);
+};
+
static inline void init_quadtree(struct quadtree *t)
{
memset(t, 0, sizeof(*t));
void (*callback)(struct quadtree *head, struct quadtree_iterator *it);
};
-struct quadtree *quadtree_add(struct quadtree *parent,
- struct quadtree *new,
- int (*compare)(struct quadtree *a,
- struct quadtree *b));
+struct quadtree *quadtree_add(struct quadtree *parent, struct quadtree *new,
+ struct quadtree_ops *ops);
-struct quadtree *quadtree_del(struct quadtree *node,
- int (*compare)(struct quadtree *a,
- struct quadtree *b));
+struct quadtree *quadtree_del(struct quadtree *node, struct quadtree_ops *ops);
int walk_quadtree(const struct quadtree_iterator *iterator);