Index: trunk/src/data.h =================================================================== --- trunk/src/data.h (revision 4771) +++ trunk/src/data.h (revision 4772) @@ -44,7 +44,7 @@ pinlist_t Via; elementlist_t Element; /**/ - rtree_t *via_tree, *element_tree, *pin_tree, *pad_tree, *name_tree[3], /* for element names */ + pcb_rtree_t *via_tree, *element_tree, *pin_tree, *pad_tree, *name_tree[3], /* for element names */ *rat_tree; pcb_board_t *pcb; pcb_layer_t Layer[MAX_LAYER + 2]; /* add 2 silkscreen layers */ Index: trunk/src/find_lookup.c =================================================================== --- trunk/src/find_lookup.c (revision 4771) +++ trunk/src/find_lookup.c (revision 4772) @@ -28,7 +28,7 @@ #include "compat_nls.h" #include "board.h" -static inline r_dir_t r_search_pt(rtree_t * rtree, const pcb_point_t * pt, +static inline r_dir_t r_search_pt(pcb_rtree_t * rtree, const pcb_point_t * pt, int radius, r_dir_t (*region_in_search) (const pcb_box_t * region, void *cl), r_dir_t (*rectangle_in_region) (const pcb_box_t * box, void *cl), void *closure, Index: trunk/src/global_typedefs.h =================================================================== --- trunk/src/global_typedefs.h (revision 4771) +++ trunk/src/global_typedefs.h (revision 4772) @@ -42,7 +42,7 @@ typedef struct pcb_polygon_s pcb_polygon_t; typedef struct pad_st pcb_pad_t; typedef struct pin_st pcb_pin_t; -typedef struct rtree rtree_t; +typedef struct pcb_rtree_s pcb_rtree_t; typedef struct rats_patch_line_s rats_patch_line_t; typedef struct element_st ElementType, *ElementTypePtr, **ElementTypeHandle; typedef struct pcb_text_s TextType, *TextTypePtr; Index: trunk/src/layer.h =================================================================== --- trunk/src/layer.h (revision 4771) +++ trunk/src/layer.h (revision 4772) @@ -48,7 +48,7 @@ textlist_t Text; polylist_t Polygon; arclist_t Arc; - rtree_t *line_tree, *text_tree, *polygon_tree, *arc_tree; + pcb_rtree_t *line_tree, *text_tree, *polygon_tree, *arc_tree; pcb_bool On; /* visible flag */ const char *Color; /* color */ const char *SelectedColor; Index: trunk/src/polyarea.h =================================================================== --- trunk/src/polyarea.h (revision 4771) +++ trunk/src/polyarea.h (revision 4772) @@ -81,7 +81,7 @@ VNODE head; unsigned int Count; double area; - rtree_t *tree; + pcb_rtree_t *tree; pcb_bool is_round; Coord cx, cy; Coord radius; @@ -113,7 +113,7 @@ struct POLYAREA { POLYAREA *f, *b; PLINE *contours; - rtree_t *contour_tree; + pcb_rtree_t *contour_tree; }; pcb_bool poly_M_Copy0(POLYAREA ** dst, const POLYAREA * srcfst); Index: trunk/src/polygon.c =================================================================== --- trunk/src/polygon.c (revision 4771) +++ trunk/src/polygon.c (revision 4772) @@ -194,7 +194,7 @@ { POLYAREA *n, *top = NULL; PLINE *pl; - rtree_t *tree; + pcb_rtree_t *tree; double big = -1; if (!p) return NULL; Index: trunk/src/polygon1.c =================================================================== --- trunk/src/polygon1.c (revision 4771) +++ trunk/src/polygon1.c (revision 4772) @@ -477,7 +477,7 @@ typedef struct info { double m, b; - rtree_t *tree; + pcb_rtree_t *tree; VNODE *v; struct seg *s; jmp_buf *env, sego, *touch; @@ -500,7 +500,7 @@ * This replaces the segment in the tree with the two new segments after * a vertex has been added */ -static int adjust_tree(rtree_t * tree, struct seg *s) +static int adjust_tree(pcb_rtree_t * tree, struct seg *s) { struct seg *q; @@ -627,7 +627,7 @@ { struct seg *s; VNODE *bv; - rtree_t *ans = r_create_tree(NULL, 0, 0); + pcb_rtree_t *ans = r_create_tree(NULL, 0, 0); bv = &pb->head; do { s = (seg *) malloc(sizeof(struct seg)); @@ -1182,7 +1182,7 @@ POLYAREA *curc; PLINE *curh, *container; heap_t *heap; - rtree_t *tree; + pcb_rtree_t *tree; int i; int num_polyareas = 0; struct polyarea_info *all_pa_info, *pa_info; @@ -2309,7 +2309,7 @@ } /* FIXME -- strict aliasing violation. */ if ((*c)->tree) { - rtree_t *r = (*c)->tree; + pcb_rtree_t *r = (*c)->tree; r_destroy_tree(&r); } free(*c), *c = NULL; @@ -2358,7 +2358,7 @@ C->area = PCB_ABS(area); if (C->Count > 2) C->Flags.orient = ((area < 0) ? PLF_INV : PLF_DIR); - C->tree = (rtree_t *) make_edge_tree(C); + C->tree = (pcb_rtree_t *) make_edge_tree(C); } /* poly_PreContour */ static r_dir_t flip_cb(const pcb_box_t * b, void *cl) @@ -2446,7 +2446,7 @@ /* newnode->Flags = cur->Flags; */ poly_InclVertex((*dst)->head.prev, newnode); } - (*dst)->tree = (rtree_t *) make_edge_tree(*dst); + (*dst)->tree = (pcb_rtree_t *) make_edge_tree(*dst); return pcb_true; } Index: trunk/src/rtree.c =================================================================== --- trunk/src/rtree.c (revision 4771) +++ trunk/src/rtree.c (revision 4772) @@ -341,14 +341,14 @@ * it, so don't free the box list until you've called r_destroy_tree. * if you set 'manage' to pcb_true, r_destroy_tree will free your boxlist. */ -rtree_t *r_create_tree(const pcb_box_t * boxlist[], int N, int manage) +pcb_rtree_t *r_create_tree(const pcb_box_t * boxlist[], int N, int manage) { - rtree_t *rtree; + pcb_rtree_t *rtree; struct rtree_node *node; int i; assert(N >= 0); - rtree = (rtree_t *) calloc(1, sizeof(*rtree)); + rtree = (pcb_rtree_t *) calloc(1, sizeof(*rtree)); /* start with a single empty leaf node */ node = (struct rtree_node *) calloc(1, sizeof(*node)); node->flags.is_leaf = 1; @@ -387,7 +387,7 @@ } /* free the memory associated with an rtree. */ -void r_destroy_tree(rtree_t ** rtree) +void r_destroy_tree(pcb_rtree_t ** rtree) { __r_destroy_tree((*rtree)->root); @@ -498,7 +498,7 @@ * Returns how the search ended. */ r_dir_t -r_search(rtree_t * rtree, const pcb_box_t * query, +r_search(pcb_rtree_t * rtree, const pcb_box_t * query, r_dir_t (*check_region) (const pcb_box_t * region, void *cl), r_dir_t (*found_rectangle) (const pcb_box_t * box, void *cl), void *cl, int *num_found) @@ -553,7 +553,7 @@ } /* return 0 if there are any rectangles in the given region. */ -int r_region_is_empty(rtree_t * rtree, const pcb_box_t * region) +int r_region_is_empty(pcb_rtree_t * rtree, const pcb_box_t * region) { jmp_buf env; int r; @@ -885,7 +885,7 @@ } } -void r_insert_entry(rtree_t * rtree, const pcb_box_t * which, int man) +void r_insert_entry(pcb_rtree_t * rtree, const pcb_box_t * which, int man) { assert(which); assert(which->X1 <= which->X2); @@ -989,7 +989,7 @@ return pcb_true; } -pcb_bool r_delete_entry(rtree_t * rtree, const pcb_box_t * box) +pcb_bool r_delete_entry(pcb_rtree_t * rtree, const pcb_box_t * box) { pcb_bool r; Index: trunk/src/rtree.h =================================================================== --- trunk/src/rtree.h (revision 4771) +++ trunk/src/rtree.h (revision 4772) @@ -38,7 +38,7 @@ #include "global_typedefs.h" -struct rtree { +struct pcb_rtree_s { struct rtree_node *root; int size; /* number of entries in tree */ }; @@ -53,12 +53,12 @@ /* create an rtree from the list of boxes. if 'manage' is pcb_true, then * the tree will take ownership of 'boxlist' and free it when the tree * is destroyed. */ -rtree_t *r_create_tree(const pcb_box_t * boxlist[], int N, int manage); +pcb_rtree_t *r_create_tree(const pcb_box_t * boxlist[], int N, int manage); /* destroy an rtree */ -void r_destroy_tree(rtree_t ** rtree); +void r_destroy_tree(pcb_rtree_t ** rtree); -pcb_bool r_delete_entry(rtree_t * rtree, const pcb_box_t * which); -void r_insert_entry(rtree_t * rtree, const pcb_box_t * which, int manage); +pcb_bool r_delete_entry(pcb_rtree_t * rtree, const pcb_box_t * which); +void r_insert_entry(pcb_rtree_t * rtree, const pcb_box_t * which, int manage); /* generic search routine */ /* region_in_search should return pcb_true if "what you're looking for" is @@ -74,7 +74,7 @@ * abort the search if that is the desired behavior. */ -r_dir_t r_search(rtree_t * rtree, const pcb_box_t * starting_region, +r_dir_t r_search(pcb_rtree_t * rtree, const pcb_box_t * starting_region, r_dir_t (*region_in_search) (const pcb_box_t * region, void *cl), r_dir_t (*rectangle_in_region) (const pcb_box_t * box, void *cl), void *closure, int *num_found); @@ -81,7 +81,7 @@ /* -- special-purpose searches build upon r_search -- */ /* return 0 if there are any rectangles in the given region. */ -int r_region_is_empty(rtree_t * rtree, const pcb_box_t * region); +int r_region_is_empty(pcb_rtree_t * rtree, const pcb_box_t * region); void __r_dump_tree(struct rtree_node *, int); Index: trunk/src_plugins/autoplace/autoplace.c =================================================================== --- trunk/src_plugins/autoplace/autoplace.c (revision 4771) +++ trunk/src_plugins/autoplace/autoplace.c (revision 4772) @@ -260,7 +260,7 @@ /* main r_find_neighbor routine. Returns NULL if no neighbor in the * requested direction. */ -static const pcb_box_t *r_find_neighbor(rtree_t * rtree, const pcb_box_t * box, direction_t search_direction) +static const pcb_box_t *r_find_neighbor(pcb_rtree_t * rtree, const pcb_box_t * box, direction_t search_direction) { struct r_neighbor_info ni; pcb_box_t bbox; @@ -464,7 +464,7 @@ }; direction_t dir[4] = { NORTH, EAST, SOUTH, WEST }; struct ebox **boxpp, *boxp; - rtree_t *rt_s, *rt_c; + pcb_rtree_t *rt_s, *rt_c; int factor; ELEMENT_LOOP(PCB->Data); { Index: trunk/src_plugins/autoroute/autoroute.c =================================================================== --- trunk/src_plugins/autoroute/autoroute.c (revision 4771) +++ trunk/src_plugins/autoroute/autoroute.c (revision 4772) @@ -300,7 +300,7 @@ typedef struct routedata { int max_styles; /* one rtree per layer *group */ - rtree_t *layergrouptree[MAX_LAYER]; /* no silkscreen layers here =) */ + pcb_rtree_t *layergrouptree[MAX_LAYER]; /* no silkscreen layers here =) */ /* root pointer into connectivity information */ routebox_t *first_net; /* default routing style */ @@ -1506,7 +1506,7 @@ /* target_guess is our guess at what the nearest target is, or NULL if we * just plum don't have a clue. */ static routebox_t *mincost_target_to_point(const Cheappcb_point_t * CostPoint, - pcb_cardinal_t CostPointLayer, rtree_t * targets, routebox_t * target_guess) + pcb_cardinal_t CostPointLayer, pcb_rtree_t * targets, routebox_t * target_guess) { struct mincost_target_closure mtc; assert(target_guess == NULL || target_guess->flags.target); /* this is a target, right? */ @@ -1527,7 +1527,7 @@ /* mincost_target_guess can be NULL */ static edge_t *CreateEdge(routebox_t * rb, Coord CostPointX, Coord CostPointY, - cost_t cost_to_point, routebox_t * mincost_target_guess, direction_t expand_dir, rtree_t * targets) + cost_t cost_to_point, routebox_t * mincost_target_guess, direction_t expand_dir, pcb_rtree_t * targets) { edge_t *e; assert(__routebox_is_good(rb)); @@ -1567,7 +1567,7 @@ /* create edge, using previous edge to fill in defaults. */ /* most of the work here is in determining a new cost point */ static edge_t *CreateEdge2(routebox_t * rb, direction_t expand_dir, - edge_t * previous_edge, rtree_t * targets, routebox_t * guess) + edge_t * previous_edge, pcb_rtree_t * targets, routebox_t * guess) { pcb_box_t thisbox; Cheappcb_point_t thiscost, prevcost; @@ -1592,7 +1592,7 @@ /* create via edge, using previous edge to fill in defaults. */ static edge_t *CreateViaEdge(const pcb_box_t * area, pcb_cardinal_t group, routebox_t * parent, edge_t * previous_edge, - conflict_t to_site_conflict, conflict_t through_site_conflict, rtree_t * targets) + conflict_t to_site_conflict, conflict_t through_site_conflict, pcb_rtree_t * targets) { routebox_t *rb; Cheappcb_point_t costpoint; @@ -1658,7 +1658,7 @@ */ static edge_t *CreateEdgeWithConflicts(const pcb_box_t * interior_edge, routebox_t * container, edge_t * previous_edge, - cost_t cost_penalty_to_box, rtree_t * targets) + cost_t cost_penalty_to_box, pcb_rtree_t * targets) { routebox_t *rb; Cheappcb_point_t costpoint; @@ -1990,7 +1990,7 @@ * looks past the clearance to see these targets even though they * weren't actually touched in the expansion. */ -struct E_result *Expand(rtree_t * rtree, edge_t * e, const pcb_box_t * box) +struct E_result *Expand(pcb_rtree_t * rtree, edge_t * e, const pcb_box_t * box) { static struct E_result ans; int noshrink; /* bit field of which edges to not shrink */ @@ -2199,8 +2199,8 @@ void moveable_edge(vector_t * result, const pcb_box_t * box, direction_t dir, routebox_t * rb, - routebox_t * blocker, edge_t * e, rtree_t * targets, - struct routeone_state *s, rtree_t * tree, vector_t * area_vec) + routebox_t * blocker, edge_t * e, pcb_rtree_t * targets, + struct routeone_state *s, pcb_rtree_t * tree, vector_t * area_vec) { pcb_box_t b; assert(box_is_good(box)); @@ -2433,7 +2433,7 @@ * targets as they are found, and putting any moveable edges * in the return vector. */ -vector_t *BreakManyEdges(struct routeone_state * s, rtree_t * targets, rtree_t * tree, +vector_t *BreakManyEdges(struct routeone_state * s, pcb_rtree_t * targets, pcb_rtree_t * tree, vector_t * area_vec, struct E_result * ans, routebox_t * rb, edge_t * e) { struct break_info bi; @@ -2741,7 +2741,7 @@ return R_DIR_FOUND_CONTINUE; } -static routebox_t *FindOneInBox(rtree_t * rtree, routebox_t * rb) +static routebox_t *FindOneInBox(pcb_rtree_t * rtree, routebox_t * rb) { struct foib_info foib; pcb_box_t r; @@ -2810,7 +2810,7 @@ } /* check for a pin or via target that a polygon can just use a thermal to connect to */ -routebox_t *FindThermable(rtree_t * rtree, routebox_t * rb) +routebox_t *FindThermable(pcb_rtree_t * rtree, routebox_t * rb) { struct therm_info info; @@ -3269,7 +3269,7 @@ /* create a fake "edge" used to defer via site searching. */ static void CreateSearchEdge(struct routeone_state *s, vetting_t * work, edge_t * parent, - routebox_t * rb, conflict_t conflict, rtree_t * targets, pcb_bool in_plane) + routebox_t * rb, conflict_t conflict, pcb_rtree_t * targets, pcb_bool in_plane) { routebox_t *target; pcb_box_t b; @@ -3349,7 +3349,7 @@ add_via_sites(struct routeone_state *s, struct routeone_via_site_state *vss, mtspace_t * mtspace, routebox_t * within, - conflict_t within_conflict_level, edge_t * parent_edge, rtree_t * targets, Coord shrink, pcb_bool in_plane) + conflict_t within_conflict_level, edge_t * parent_edge, pcb_rtree_t * targets, Coord shrink, pcb_bool in_plane) { Coord radius, clearance; vetting_t *work; @@ -3375,7 +3375,7 @@ void do_via_search(edge_t * search, struct routeone_state *s, - struct routeone_via_site_state *vss, mtspace_t * mtspace, rtree_t * targets) + struct routeone_via_site_state *vss, mtspace_t * mtspace, pcb_rtree_t * targets) { int i, j, count = 0; Coord radius, clearance; @@ -3527,7 +3527,7 @@ return R_DIR_FOUND_CONTINUE; } -static void source_conflicts(rtree_t * tree, routebox_t * rb) +static void source_conflicts(pcb_rtree_t * tree, routebox_t * rb) { if (!AutoRouteParameters.with_conflicts) return; @@ -3550,7 +3550,7 @@ int seen, i; const pcb_box_t **target_list; int num_targets; - rtree_t *targets; + pcb_rtree_t *targets; /* vector of source edges for filtering */ vector_t *source_vec; /* working vector */ Index: trunk/src_plugins/autoroute/mtspace.c =================================================================== --- trunk/src_plugins/autoroute/mtspace.c (revision 4771) +++ trunk/src_plugins/autoroute/mtspace.c (revision 4772) @@ -60,7 +60,7 @@ struct mtspace { /* rtrees keeping track of regions expanded by their required clearance. */ /* one for fixed, even, and odd */ - rtree_t *ftree, *etree, *otree; + pcb_rtree_t *ftree, *etree, *otree; }; typedef union { @@ -121,7 +121,7 @@ struct mts_info { Coord clearance; pcb_box_t box; - rtree_t *tree; + pcb_rtree_t *tree; jmp_buf env; }; @@ -140,7 +140,7 @@ return R_DIR_NOT_FOUND; } -rtree_t *which_tree(mtspace_t * mtspace, mtspace_type_t which) +pcb_rtree_t *which_tree(mtspace_t * mtspace, mtspace_type_t which) { switch (which) { case FIXED: @@ -295,7 +295,7 @@ * it returns pcb_true if it has exhausted the region vector/heap and never * found an empty area. */ -static void qloop(struct query_closure *qc, rtree_t * tree, heap_or_vector res, pcb_bool is_vec) +static void qloop(struct query_closure *qc, pcb_rtree_t * tree, heap_or_vector res, pcb_bool is_vec) { pcb_box_t *cbox; int n;