Index: trunk/src/obj_pstk.h =================================================================== --- trunk/src/obj_pstk.h (revision 19788) +++ trunk/src/obj_pstk.h (revision 19789) @@ -143,6 +143,10 @@ /* free fields of a proto (not freeing the proto itself, not removing it from lists */ void pcb_pstk_proto_free_fields(pcb_pstk_proto_t *dst); +/* low level: allocate a new, uninitialized shape at the end of a transformed shape + WARNING: this should be done on all transformed shapes in parallel! */ +pcb_pstk_shape_t *pcb_pstk_alloc_append_shape(pcb_pstk_tshape_t *ts); + /* allocate/free the point array of a poly shape (single allocation for x and y) */ void pcb_pstk_shape_alloc_poly(pcb_pstk_poly_t *poly, int len); void pcb_pstk_shape_free_poly(pcb_pstk_poly_t *poly); Index: trunk/src/obj_pstk_proto.c =================================================================== --- trunk/src/obj_pstk_proto.c (revision 19788) +++ trunk/src/obj_pstk_proto.c (revision 19789) @@ -98,6 +98,16 @@ return -1; } +pcb_pstk_shape_t *pcb_pstk_alloc_append_shape(pcb_pstk_tshape_t *ts) +{ + int idx = ts->len; + + ts->len++; + ts->shape = realloc(ts->shape, ts->len * sizeof(pcb_pstk_shape_t)); + + return &ts->shape[idx]; +} + static void append_circle(pcb_pstk_tshape_t *ts, pcb_layer_type_t lyt, pcb_layer_combining_t comb, pcb_coord_t dia) { int idx = ts->len;