5 struct quadtree *child[4];
6 struct quadtree *parent;
9 static inline void init_quadtree(struct quadtree *t)
13 for (i = 0; i < 4; i++)
18 #define QUADTREE_UPLEFT 0x1
19 #define QUADTREE_UPRIGHT 0x2
20 #define QUADTREE_DOWNLEFT 0x4
21 #define QUADTREE_DOWNRIGHT 0x8
22 #define QUADTREE_SELF 0x10
24 struct quadtree_iterator {
25 struct quadtree *head;
28 int (*direction)(struct quadtree *head, void *ptr);
29 void (*callback)(struct quadtree *head, void *ptr);
32 struct quadtree *quadtree_add(struct quadtree *parent,
34 int (*compare)(struct quadtree *a,
37 int walk_tree(const struct quadtree_iterator *iterator);