Index: trunk/src/route_style.c =================================================================== --- trunk/src/route_style.c (revision 2597) +++ trunk/src/route_style.c (revision 2598) @@ -154,6 +154,13 @@ conf_set_design("design/clearance", "%$mS", rst->Clearance); } +int pcb_use_route_style_idx(vtroutestyle_t *styles, int idx) +{ + if ((idx < 0) || (idx >= vtroutestyle_len(styles))) + return -1; + pcb_use_route_style(styles->array+idx); + return 0; +} #define cmp(a,b) (((a) != 0) && ((a) == (b))) #define cmps(a,b) (((a) != NULL) && (strcmp((a), (b)) == 0)) Index: trunk/src/route_style.h =================================================================== --- trunk/src/route_style.h (revision 2597) +++ trunk/src/route_style.h (revision 2598) @@ -43,8 +43,12 @@ char *make_route_string(vtroutestyle_t *styles); /* Set design configuration (the pen we draw with) to a given route style */ -void pcb_use_route_style(RouteStyleType *); +void pcb_use_route_style(RouteStyleType *rst); +/* Same as pcb_use_route_style() but uses one of the styles in a vector; + returns -1 if idx is out of bounds, 0 on success. */ +int pcb_use_route_style_idx(vtroutestyle_t *styles, int idx); + /* Compare supplied parameters to each style in the vector and return the index of the first mathcing style. All non-0 parameters need to match to accept a style. Return -1 on no match. */