#include #include #include "regions.h" int main() { region_t rgn = {{NULL}}; point_t pt = {9, 0}; rect_t r[2] = { {0, 0, 9, 9}, {10, 10, 19, 19} }; rect_node_t *rn; int i; for (i = 0; i < 2; ++i) { rn = (rect_node_t *)malloc(sizeof(rect_node_t)); rn->rect.left = r[i].left; rn->rect.top = r[i].top; rn->rect.right = r[i].right; rn->rect.bottom = r[i].bottom; add_node(&rn->node, &rgn.rects); } if (point_in_rgn(&pt, &rgn)) puts("Point is in the region."); else puts("Point is NOT in the region."); return 0; }