Index: trunk/src/obj_pstk.h =================================================================== --- trunk/src/obj_pstk.h (revision 12925) +++ trunk/src/obj_pstk.h (revision 12926) @@ -137,6 +137,9 @@ /* grow (or shrink) a prototype to or by val - change the proto in place */ void pcb_pstk_proto_grow(pcb_pstk_proto_t *proto, pcb_bool is_absolute, pcb_coord_t val); +/* Look up the shape index corresponding to a lty/comb; returns -1 if not found/empty */ +int pcb_pstk_get_shape_idx(pcb_pstk_tshape_t *ts, pcb_layer_type_t lyt, pcb_layer_combining_t comb); + /* Remove a shape from the proto (either by layer or by idx) */ void pcb_pstk_proto_del_shape(pcb_pstk_proto_t *proto, pcb_layer_type_t lyt, pcb_layer_combining_t comb); void pcb_pstk_proto_del_shape_idx(pcb_pstk_proto_t *proto, int idx); Index: trunk/src/obj_pstk_proto.c =================================================================== --- trunk/src/obj_pstk_proto.c (revision 12925) +++ trunk/src/obj_pstk_proto.c (revision 12926) @@ -58,7 +58,7 @@ pcb_pstk_shape_update_pa(dst); } -static int get_shape_idx(pcb_pstk_tshape_t *ts, pcb_layer_type_t lyt, pcb_layer_combining_t comb) +int pcb_pstk_get_shape_idx(pcb_pstk_tshape_t *ts, pcb_layer_type_t lyt, pcb_layer_combining_t comb) { int n; for(n = 0; n < ts->len; n++) @@ -217,16 +217,16 @@ /* if there was a via, use the via's shape on layers that are not specified */ if (via != NULL) { - if (get_shape_idx(ts, PCB_LYT_COPPER | PCB_LYT_TOP, 0) == -1) + if (pcb_pstk_get_shape_idx(ts, PCB_LYT_COPPER | PCB_LYT_TOP, 0) == -1) append_circle(ts, PCB_LYT_COPPER | PCB_LYT_TOP, 0, via->Thickness); - if (get_shape_idx(ts, PCB_LYT_COPPER | PCB_LYT_INTERN, 0) == -1) + if (pcb_pstk_get_shape_idx(ts, PCB_LYT_COPPER | PCB_LYT_INTERN, 0) == -1) append_circle(ts, PCB_LYT_COPPER | PCB_LYT_INTERN, 0, via->Thickness); - if (get_shape_idx(ts, PCB_LYT_COPPER | PCB_LYT_BOTTOM, 0) == -1) + if (pcb_pstk_get_shape_idx(ts, PCB_LYT_COPPER | PCB_LYT_BOTTOM, 0) == -1) append_circle(ts, PCB_LYT_COPPER | PCB_LYT_BOTTOM, 0, via->Thickness); if (via->Mask > 0) { - if (get_shape_idx(ts, PCB_LYT_MASK | PCB_LYT_BOTTOM, PCB_LYC_SUB) == -1) + if (pcb_pstk_get_shape_idx(ts, PCB_LYT_MASK | PCB_LYT_BOTTOM, PCB_LYC_SUB) == -1) append_circle(ts, PCB_LYT_MASK | PCB_LYT_BOTTOM, PCB_LYC_SUB, via->Mask); - if (get_shape_idx(ts, PCB_LYT_MASK | PCB_LYT_TOP, PCB_LYC_SUB) == -1) + if (pcb_pstk_get_shape_idx(ts, PCB_LYT_MASK | PCB_LYT_TOP, PCB_LYC_SUB) == -1) append_circle(ts, PCB_LYT_MASK | PCB_LYT_TOP, PCB_LYC_SUB, via->Mask); } } @@ -713,7 +713,7 @@ return; /* search the 0th transformed, all other tshapes are the same */ - idx = get_shape_idx(&proto->tr.array[0], lyt, comb); + idx = pcb_pstk_get_shape_idx(&proto->tr.array[0], lyt, comb); pcb_pstk_proto_del_shape_idx(proto, idx); }