Index: trunk/doc-rnd/TODO =================================================================== --- trunk/doc-rnd/TODO (revision 2032) +++ trunk/doc-rnd/TODO (revision 2033) @@ -1,4 +1,9 @@ - replace settings with lihata (conf_*) + - do not save route styles as attribute? or maybe this is the way to keep more than 4 with pcb mainline? + - dynamic route style bugs: + - gtk hid new style is not "this session only" + - check why there is an extra empty route style + - try to remove globalconst.h in favor of config - make route style number dynamic? - color file: a plugin for importing/exporting colors - gtk hid: clean up the #warnings @@ -41,6 +46,8 @@ - gtk, preferences dialog, user pov - test if all plugins work from .so - test clearance + drc clearance + - route style in gtk and lesstif, save, load, 0, 1 or a lot of styles + - route style vs. autorouter BUGS: - arc bug: draw an arc with one end out of the drawing area; it will be jumpy and can not be placed properly Index: trunk/globalconst.h =================================================================== --- trunk/globalconst.h (revision 2032) +++ trunk/globalconst.h (revision 2033) @@ -71,7 +71,6 @@ #define MAX_LAYER 16 /* max number of layer, check source */ /* code for more changes, a *lot* more changes */ #define DEF_LAYER 8 /* default number of layers for new boards */ -#define NUM_STYLES 4 #define MIN_LINESIZE MIL_TO_COORD(0.01) /* thickness of lines */ #define MAX_LINESIZE LARGE_VALUE #define MIN_TEXTSCALE 10 /* scaling of text objects in percent */ Index: trunk/src/Makefile.in =================================================================== --- trunk/src/Makefile.in (revision 2032) +++ trunk/src/Makefile.in (revision 2033) @@ -84,7 +84,6 @@ polygon.o polygon1.o polygon_act.o - rats.o rats_act.o rats_patch.o @@ -91,6 +90,7 @@ remove.o remove_act.o rotate.o + route_style.o rtree.o rubberband.o search.o @@ -109,6 +109,7 @@ vtlibrary.o vtonpoint.o vtptr.o + vtroutestyle.o buildin.o ../src_3rd/liblihata/parser.o ../src_3rd/liblihata/dom.o Index: trunk/src/conf_act.c =================================================================== --- trunk/src/conf_act.c (revision 2032) +++ trunk/src/conf_act.c (revision 2033) @@ -31,6 +31,7 @@ #include "error.h" #include "misc.h" #include "misc_util.h" +#include "route_style.h" static const char conf_syntax[] = "conf(set, path, value, [role], [policy]) - change a config setting\n" Index: trunk/src/global.h =================================================================== --- trunk/src/global.h (revision 2032) +++ trunk/src/global.h (revision 2033) @@ -69,6 +69,7 @@ #include "vtonpoint.h" #include "hid.h" #include "polyarea.h" +#include "vtroutestyle.h" /* Internationalization support. */ @@ -234,15 +235,6 @@ DrillTypePtr Drill; /* plated holes */ } DrillInfoType, *DrillInfoTypePtr; -typedef struct { - Coord Thick, /* line thickness */ - Diameter, /* via diameter */ - Hole, /* via drill hole */ - Clearance; /* min. separation from other nets */ - char *Name; - int index; -} RouteStyleType, *RouteStyleTypePtr; - typedef struct LibraryEntryTpye_s LibraryEntryType, *LibraryEntryTypePtr; typedef struct LibraryMenuType_s LibraryMenuType, *LibraryMenuTypePtr; @@ -334,7 +326,7 @@ ThermScale; /* scale factor used with thermals */ FontType Font; LayerGroupType LayerGroups; - RouteStyleType RouteStyle[NUM_STYLES]; + vtroutestyle_t RouteStyle; LibraryType NetlistLib[NUM_NETLISTS]; rats_patch_line_t *NetlistPatches, *NetlistPatchLast; AttributeListType Attributes; Index: trunk/src/gui_act.c =================================================================== --- trunk/src/gui_act.c (revision 2032) +++ trunk/src/gui_act.c (revision 2033) @@ -1000,8 +1000,8 @@ if (str) { number = atoi(str); - if (number > 0 && number <= NUM_STYLES) { - rts = &PCB->RouteStyle[number - 1]; + if (number > 0 && number <= vtroutestyle_len(&PCB->RouteStyle)) { + rts = &PCB->RouteStyle.array[number - 1]; SetLineSize(rts->Thick); SetViaSize(rts->Diameter, true); SetViaDrillingHole(rts->Hole, true); Index: trunk/src/macro.h =================================================================== --- trunk/src/macro.h (revision 2032) +++ trunk/src/macro.h (revision 2033) @@ -177,13 +177,6 @@ */ #define END_LOOP }} while (0) -#define STYLE_LOOP(top) do { \ - Cardinal n; \ - RouteStyleTypePtr style; \ - for (n = 0; n < NUM_STYLES; n++) \ - { \ - style = &(top)->RouteStyle[n] - #define VIA_LOOP(top) do { \ PinType *via; \ gdl_iterator_t __it__; \ Index: trunk/src/misc.c =================================================================== --- trunk/src/misc.c (revision 2032) +++ trunk/src/misc.c (revision 2033) @@ -716,7 +716,7 @@ Ptr->DefaultSymbol.Y2 = Ptr->DefaultSymbol.Y1 + Ptr->MaxHeight; } -static Coord GetNum(char **s, const char *default_unit) +Coord GetNum(char **s, const char *default_unit) { /* Read value */ Coord ret_val = GetValueEx(*s, NULL, NULL, NULL, default_unit, NULL); @@ -726,113 +726,7 @@ return ret_val; } -/*! \brief Serializes the route style list - * \par Function Description - * Right now n_styles should always be set to NUM_STYLES, - * since that is the number of route styles ParseRouteString() - * expects to parse. - */ -char *make_route_string(RouteStyleType rs[], int n_styles) -{ - gds_t str; - int i; - - gds_init(&str); - for (i = 0; i < n_styles; ++i) { - pcb_append_printf(&str, "%s,%mc,%mc,%mc,%mc", rs[i].Name, - rs[i].Thick, rs[i].Diameter, - rs[i].Hole, rs[i].Clearance); - if (i > 0) - gds_append(&str, ':'); - } - return str.array; /* this is the only allocation made, return this and don't uninit */ -} - /* ---------------------------------------------------------------------- - * parses the routes definition string which is a colon separated list of - * comma separated Name, Dimension, Dimension, Dimension, Dimension - * e.g. Signal,20,40,20,10:Power,40,60,28,10:... - */ -int ParseRoutingString1(char **str, RouteStyleTypePtr routeStyle, const char *default_unit) -{ - char *s = *str; - char Name[256]; - int i; - - while (*s && isspace((int) *s)) - s++; - for (i = 0; *s && *s != ','; i++) - Name[i] = *s++; - Name[i] = '\0'; - routeStyle->Name = strdup(Name); - if (!isdigit((int) *++s)) - goto error; - routeStyle->Thick = GetNum(&s, default_unit); - while (*s && isspace((int) *s)) - s++; - if (*s++ != ',') - goto error; - while (*s && isspace((int) *s)) - s++; - if (!isdigit((int) *s)) - goto error; - routeStyle->Diameter = GetNum(&s, default_unit); - while (*s && isspace((int) *s)) - s++; - if (*s++ != ',') - goto error; - while (*s && isspace((int) *s)) - s++; - if (!isdigit((int) *s)) - goto error; - routeStyle->Hole = GetNum(&s, default_unit); - /* for backwards-compatibility, we use a 10-mil default - * for styles which omit the clearance specification. */ - if (*s != ',') - routeStyle->Clearance = MIL_TO_COORD(10); - else { - s++; - while (*s && isspace((int) *s)) - s++; - if (!isdigit((int) *s)) - goto error; - routeStyle->Clearance = GetNum(&s, default_unit); - while (*s && isspace((int) *s)) - s++; - } - - *str = s; - return 0; - error:; - *str = s; - return -1; -} - -int ParseRouteString(char *s, RouteStyleTypePtr routeStyle, const char *default_unit) -{ - int style; - - - memset(routeStyle, 0, NUM_STYLES * sizeof(RouteStyleType)); - for (style = 0; style < NUM_STYLES; style++, routeStyle++) { - - ParseRoutingString1(&s, routeStyle, default_unit); - - if (style < NUM_STYLES - 1) { - while (*s && isspace((int) *s)) - s++; - if (*s++ != ':') - goto error; - } - } - return (0); - -error: - memset(routeStyle, 0, NUM_STYLES * sizeof(RouteStyleType)); - return (1); -} - -/* ---------------------------------------------------------------------- * parses the group definition string which is a colon separated list of * comma separated layer numbers (1,2,b:4,6,8,t) */ Index: trunk/src/misc.h =================================================================== --- trunk/src/misc.h (revision 2032) +++ trunk/src/misc.h (revision 2033) @@ -57,14 +57,9 @@ BoxTypePtr GetDataBoundingBox(DataTypePtr); void CenterDisplay(Coord, Coord); void SetFontInfo(FontTypePtr); -char *make_route_string(RouteStyleType rs[], int n_styles); int ParseGroupString(char *, LayerGroupTypePtr, int /* LayerN */ ); +Coord GetNum(char **s, const char *default_unit); -/* Parse a single route string into one RouteStyleTypePtr slot */ -int ParseRoutingString1(char **str, RouteStyleTypePtr routeStyle, const char *default_unit); -/* Parse a ':' separated list of route strings into a full RouteStyleTypePtr array */ -int ParseRouteString(char *, RouteStyleTypePtr, const char *); - void QuitApplication(void); char *EvaluateFilename(char *, char *, char *, char *); void SetTextBoundingBox(FontTypePtr, TextTypePtr); Index: trunk/src/mymem.c =================================================================== --- trunk/src/mymem.c (revision 2032) +++ trunk/src/mymem.c (revision 2033) @@ -614,9 +614,7 @@ free(pcb->Font.Symbol[i].Line); for (i = 0; i < NUM_NETLISTS; i++) FreeLibraryMemory(&(pcb->NetlistLib[i])); - for (i = 0; i < NUM_STYLES; i++) - if (pcb->RouteStyle[i].Name != NULL) - free(pcb->RouteStyle[i].Name); + vtroutestyle_uninit(&pcb->RouteStyle); FreeAttributeListMemory(&pcb->Attributes); /* clear struct */ memset(pcb, 0, sizeof(PCBType)); Index: trunk/src/plug_io.c =================================================================== --- trunk/src/plug_io.c (revision 2032) +++ trunk/src/plug_io.c (revision 2033) @@ -473,10 +473,14 @@ { if (hid_get_flag("GetStyle()")) return; - SetLineSize(PCB->RouteStyle[0].Thick); - SetViaSize(PCB->RouteStyle[0].Diameter, true); - SetViaDrillingHole(PCB->RouteStyle[0].Hole, true); - SetClearanceWidth(PCB->RouteStyle[0].Clearance); + + if (vtroutestyle_len(&PCB->RouteStyle) > 0) { +#warning TODO: call some central setter instead so we don't need to know the field names here + SetLineSize(PCB->RouteStyle.array[0].Thick); + SetViaSize(PCB->RouteStyle.array[0].Diameter, true); + SetViaDrillingHole(PCB->RouteStyle.array[0].Hole, true); + SetClearanceWidth(PCB->RouteStyle.array[0].Clearance); + } } /* --------------------------------------------------------------------------- Index: trunk/src/rats.c =================================================================== --- trunk/src/rats.c (revision 2032) +++ trunk/src/rats.c (revision 2033) @@ -52,8 +52,8 @@ #include "search.h" #include "undo.h" #include "stub_mincut.h" +#include "route_style.h" - RCSID("$Id$"); @@ -229,7 +229,7 @@ if (menu->Style) { STYLE_LOOP(PCB); { - if (style->Name && !NSTRCMP(style->Name, menu->Style)) { + if (style->name && !NSTRCMP(style->name, menu->Style)) { net->Style = style; break; } Index: trunk/src/route_style.c =================================================================== --- trunk/src/route_style.c (nonexistent) +++ trunk/src/route_style.c (revision 2033) @@ -0,0 +1,145 @@ +/* + * COPYRIGHT + * + * PCB, interactive printed circuit board design + * Copyright (C) 1994,1995,1996,2004,2006 Thomas Nau + * Copyright (C) 2016 Tibor 'Igor2' Palinkas + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + * + * Contact addresses for paper mail and Email: + * Thomas Nau, Schlehenweg 15, 88471 Baustetten, Germany + * Thomas.Nau@rz.uni-ulm.de + * + */ +#include "config.h" +#include "global.h" +#include "pcb-printf.h" +#include "genvector/gds_char.h" +#include "route_style.h" +#include "misc.h" +#include "error.h" + +/*! \brief Serializes the route style list + * \par Function Description + * Right now n_styles should always be set to NUM_STYLES, + * since that is the number of route styles ParseRouteString() + * expects to parse. + */ +char *make_route_string(vtroutestyle_t *styles) +{ + gds_t str; + int i; + + gds_init(&str); + for (i = 0; i < vtroutestyle_len(styles); ++i) { + pcb_append_printf(&str, "%s,%mc,%mc,%mc,%mc", styles->array[i].name, + styles->array[i].Thick, styles->array[i].Diameter, + styles->array[i].Hole, styles->array[i].Clearance); + if (i > 0) + gds_append(&str, ':'); + } + return str.array; /* this is the only allocation made, return this and don't uninit */ +} + +/* ---------------------------------------------------------------------- + * parses the routes definition string which is a colon separated list of + * comma separated Name, Dimension, Dimension, Dimension, Dimension + * e.g. Signal,20,40,20,10:Power,40,60,28,10:... + */ +int ParseRoutingString1(char **str, RouteStyleTypePtr routeStyle, const char *default_unit) +{ + char *s = *str; + char Name[256]; + int i, len; + + while (*s && isspace((int) *s)) + s++; + for (i = 0; *s && *s != ','; i++) + Name[i] = *s++; + Name[i] = '\0'; + len = strlen(Name); + if (len > sizeof(routeStyle->name)-1) { + memcpy(routeStyle->name, Name, sizeof(routeStyle->name)-1); + routeStyle->name[sizeof(routeStyle->name)-1] = '\0'; + Message("Route style name '%s' too long, truncated to '%s'\n", Name, routeStyle->name); + } + else + strcpy(routeStyle->name, Name); + if (!isdigit((int) *++s)) + goto error; + routeStyle->Thick = GetNum(&s, default_unit); + while (*s && isspace((int) *s)) + s++; + if (*s++ != ',') + goto error; + while (*s && isspace((int) *s)) + s++; + if (!isdigit((int) *s)) + goto error; + routeStyle->Diameter = GetNum(&s, default_unit); + while (*s && isspace((int) *s)) + s++; + if (*s++ != ',') + goto error; + while (*s && isspace((int) *s)) + s++; + if (!isdigit((int) *s)) + goto error; + routeStyle->Hole = GetNum(&s, default_unit); + /* for backwards-compatibility, we use a 10-mil default + * for styles which omit the clearance specification. */ + if (*s != ',') + routeStyle->Clearance = MIL_TO_COORD(10); + else { + s++; + while (*s && isspace((int) *s)) + s++; + if (!isdigit((int) *s)) + goto error; + routeStyle->Clearance = GetNum(&s, default_unit); + while (*s && isspace((int) *s)) + s++; + } + + *str = s; + return 0; + error:; + *str = s; + return -1; +} + +int ParseRouteString(char *s, vtroutestyle_t *styles, const char *default_unit) +{ + int n; + + vtroutestyle_truncate(styles, 0); + for(n = 0;;n++) { + vtroutestyle_enlarge(styles, n+1); + if (ParseRoutingString1(&s, &styles->array[n], default_unit) != 0) { + vtroutestyle_truncate(styles, n); + break; + } + while (*s && isspace((int) *s)) + s++; + if (*s == '\0') + break; + if (*s++ != ':') { + vtroutestyle_truncate(styles, 0); + return -1; + } + } + return 0; +} Index: trunk/src/route_style.h =================================================================== --- trunk/src/route_style.h (nonexistent) +++ trunk/src/route_style.h (revision 2033) @@ -0,0 +1,44 @@ +/* + * COPYRIGHT + * + * PCB, interactive printed circuit board design + * Copyright (C) 1994,1995,1996, 2004 Thomas Nau + * Copyright (C) 2016 Tibor 'Igor2' Palinkas + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + * + * Contact addresses for paper mail and Email: + * Thomas Nau, Schlehenweg 15, 88471 Baustetten, Germany + * Thomas.Nau@rz.uni-ulm.de + * + * RCS: $Id$ + */ + +#define STYLE_LOOP(top) do { \ + Cardinal n; \ + RouteStyleTypePtr style; \ + for (n = 0; n < vtroutestyle_len(&(top)->RouteStyle); n++) \ + { \ + style = &(top)->RouteStyle.array[n] + +/* Parse a single route string into one RouteStyleTypePtr slot. Returns 0 on success. */ +int ParseRoutingString1(char **str, RouteStyleTypePtr routeStyle, const char *default_unit); + +/* Parse a ':' separated list of route strings into a styles vector + The vector is initialized before the call. On error the vector is left empty + (but still initialized). Returns 0 on success. */ +int ParseRouteString(char *s, vtroutestyle_t *styles, const char *default_unit); + +char *make_route_string(vtroutestyle_t *styles); Index: trunk/src/set.c =================================================================== --- trunk/src/set.c (revision 2032) +++ trunk/src/set.c (revision 2033) @@ -51,6 +51,7 @@ #include "set.h" #include "undo.h" #include "hid_actions.h" +#include "route_style.h" RCSID("$Id$"); @@ -272,7 +273,7 @@ STYLE_LOOP(PCB); { - if (name && NSTRCMP(name, style->Name) == 0) { + if (name && NSTRCMP(name, style->name) == 0) { sprintf(num, "%d", n + 1); hid_actionl("RouteStyle", num, NULL); break; Index: trunk/src/vtroutestyle.c =================================================================== --- trunk/src/vtroutestyle.c (nonexistent) +++ trunk/src/vtroutestyle.c (revision 2033) @@ -0,0 +1,3 @@ +#define GVT_DONT_UNDEF +#include "vtroutestyle.h" +#include Index: trunk/src/vtroutestyle.h =================================================================== --- trunk/src/vtroutestyle.h (nonexistent) +++ trunk/src/vtroutestyle.h (revision 2033) @@ -0,0 +1,74 @@ +#include +#include +#include "unit.h" + +/* Elem=RouteStyle; init=0 */ + +typedef struct { + Coord Thick, /* line thickness */ + Diameter, /* via diameter */ + Hole, /* via drill hole */ + Clearance; /* min. separation from other nets */ + char name[32]; /* fixed length name to save malloc/free */ +/* int index;*/ +} RouteStyleType, *RouteStyleTypePtr; + +/* all public symbols are wrapped in GVT() - see vt_t(7) */ +#define GVT(x) vtroutestyle_ ## x +#define HAVE_VTROUTESTYLE_T + +/* Array elem type - see vt_t(7) */ +#define GVT_ELEM_TYPE RouteStyleType + +/* Type that represents array lengths - see vt_t(7) */ +#define GVT_SIZE_TYPE size_t + +/* Below this length, always double allocation size when the array grows */ +#define GVT_DOUBLING_THRS 16 + +/* Initial array size when the first element is written */ +#define GVT_START_SIZE 4 + +/* Optional terminator; when present, it is always appended at the end - see + vt_term(7)*/ +/* #define GVT_TERM '\0' */ + +/* Optional prefix for function definitions (e.g. static inline) */ +#define GVT_FUNC + +/* Enable this to set all new bytes ever allocated to this value - see + vt_set_new_bytes_to(7) */ +#define GVT_SET_NEW_BYTES_TO 0 + +/* Enable GVT_INIT_ELEM_FUNC and an user configured function is called + for each new element allocated (even between used and alloced). + See vt_init_elem(7) */ +/*#define GVT_INIT_ELEM_FUNC*/ + +/* Enable GVT_ELEM_CONSTRUCTOR and an user configured function is called + for each element that is getting within the range of ->used. + See vt_construction(7) */ +/*#define GVT_ELEM_CONSTRUCTOR */ + +/* Enable GVT_ELEM_DESTRUCTOR and an user configured function is called + for each element that was once constructed and now getting beyong ->used. + See vt_construction(7) */ +/*#define GVT_ELEM_DESTRUCTOR */ + +/* Enable GVT_ELEM_COPY and an user configured function is called + for copying elements into the array. + See vt_construction(7) */ +/*#define GVT_ELEM_COPY */ + +/* Optional extra fields in the vector struct - see vt_user_fields(7) */ +/* #define GVT_USER_FIELDS int foo; char bar[12]; */ + +/* Include the actual header implementation */ +#include + +/* Memory allocator - see vt_allocation(7) */ +#define GVT_REALLOC(vect, ptr, size) realloc(ptr, size) +#define GVT_FREE(vect, ptr) free(ptr) + +/* clean up #defines */ +#include Index: trunk/src_plugins/autoroute/autoroute.c =================================================================== --- trunk/src_plugins/autoroute/autoroute.c (revision 2032) +++ trunk/src_plugins/autoroute/autoroute.c (revision 2033) @@ -299,6 +299,7 @@ } routebox_t; typedef struct routedata { + int max_styles; /* one rtree per layer *group */ rtree_t *layergrouptree[MAX_LAYER]; /* no silkscreen layers here =) */ /* root pointer into connectivity information */ @@ -306,7 +307,7 @@ /* default routing style */ RouteStyleType defaultstyle; /* style structures */ - RouteStyleType *styles[NUM_STYLES + 1]; + RouteStyleType **styles; /* [max_styles+1] */ /* what is the maximum bloat (clearance+line half-width or * clearance+via_radius) for any style we've seen? */ Coord max_bloat; @@ -892,6 +893,11 @@ /* create routedata */ rd = (routedata_t *) malloc(sizeof(*rd)); memset((void *) rd, 0, sizeof(*rd)); + + rd->max_styles = vtroutestyle_len(&PCB->RouteStyle); +/* rd->layergrouptree = calloc(sizeof(rd->layergrouptree[0]), rd->max_layers);*/ + rd->styles = calloc(sizeof(rd->styles[0]), rd->max_styles); + /* create default style */ rd->defaultstyle.Thick = conf_core.design.line_thickness; rd->defaultstyle.Diameter = conf_core.design.via_thickness; @@ -903,8 +909,8 @@ bbox.X1 = bbox.Y1 = 0; bbox.X2 = PCB->MaxWidth; bbox.Y2 = PCB->MaxHeight; - for (i = 0; i < NUM_STYLES + 1; i++) { - RouteStyleType *style = (i < NUM_STYLES) ? &PCB->RouteStyle[i] : &rd->defaultstyle; + for (i = 0; i < rd->max_styles + 1; i++) { + RouteStyleType *style = (i < rd->max_styles) ? &PCB->RouteStyle.array[i] : &rd->defaultstyle; rd->styles[i] = style; } @@ -942,7 +948,7 @@ routebox_t *last_in_subnet = NULL; int j; - for (j = 0; j < NUM_STYLES; j++) + for (j = 0; j < rd->max_styles; j++) if (net->Style == rd->styles[j]) break; CONNECTION_LOOP(net); @@ -1041,7 +1047,7 @@ if (TEST_FLAG(DRCFLAG, pin)) CLEAR_FLAG(DRCFLAG, pin); else - AddPin(layergroupboxes, pin, false, rd->styles[NUM_STYLES]); + AddPin(layergroupboxes, pin, false, rd->styles[rd->max_styles]); } ENDALL_LOOP; ALLPAD_LOOP(PCB->Data); @@ -1049,7 +1055,7 @@ if (TEST_FLAG(DRCFLAG, pad)) CLEAR_FLAG(DRCFLAG, pad); else - AddPad(layergroupboxes, element, pad, rd->styles[NUM_STYLES]); + AddPad(layergroupboxes, element, pad, rd->styles[rd->max_styles]); } ENDALL_LOOP; /* add all vias */ @@ -1058,7 +1064,7 @@ if (TEST_FLAG(DRCFLAG, via)) CLEAR_FLAG(DRCFLAG, via); else - AddPin(layergroupboxes, via, true, rd->styles[NUM_STYLES]); + AddPin(layergroupboxes, via, true, rd->styles[rd->max_styles]); } END_LOOP; @@ -1086,14 +1092,14 @@ fake_line.Point2.Y = fake_line.Point1.Y + dy; if (fake_line.Point2.X == line->Point2.X && fake_line.Point2.Y == line->Point2.Y) break; - AddLine(layergroupboxes, layergroup, &fake_line, line, rd->styles[NUM_STYLES]); + AddLine(layergroupboxes, layergroup, &fake_line, line, rd->styles[rd->max_styles]); fake_line.Point1 = fake_line.Point2; } fake_line.Point2 = line->Point2; - AddLine(layergroupboxes, layergroup, &fake_line, line, rd->styles[NUM_STYLES]); + AddLine(layergroupboxes, layergroup, &fake_line, line, rd->styles[rd->max_styles]); } else { - AddLine(layergroupboxes, layergroup, line, line, rd->styles[NUM_STYLES]); + AddLine(layergroupboxes, layergroup, line, line, rd->styles[rd->max_styles]); } } END_LOOP; @@ -1103,19 +1109,19 @@ if (TEST_FLAG(DRCFLAG, polygon)) CLEAR_FLAG(DRCFLAG, polygon); else - AddPolygon(layergroupboxes, i, polygon, rd->styles[NUM_STYLES]); + AddPolygon(layergroupboxes, i, polygon, rd->styles[rd->max_styles]); } END_LOOP; /* add all copper text */ TEXT_LOOP(LAYER_PTR(i)); { - AddText(layergroupboxes, layergroup, text, rd->styles[NUM_STYLES]); + AddText(layergroupboxes, layergroup, text, rd->styles[rd->max_styles]); } END_LOOP; /* add all arcs */ ARC_LOOP(LAYER_PTR(i)); { - AddArc(layergroupboxes, layergroup, arc, rd->styles[NUM_STYLES]); + AddArc(layergroupboxes, layergroup, arc, rd->styles[rd->max_styles]); } END_LOOP; } @@ -1155,6 +1161,8 @@ r_destroy_tree(&(*rd)->layergrouptree[i]); if (AutoRouteParameters.use_vias) mtspace_destroy(&(*rd)->mtspace); +/* free((*rd)->layergrouptree);*/ + free((*rd)->styles); free(*rd); *rd = NULL; } @@ -4537,9 +4545,9 @@ } #endif - for (i = 0; i < NUM_STYLES; i++) { - if (PCB->RouteStyle[i].Thick == 0 || - PCB->RouteStyle[1].Diameter == 0 || PCB->RouteStyle[1].Hole == 0 || PCB->RouteStyle[i].Clearance == 0) { + for (i = 0; i < vtroutestyle_len(&PCB->RouteStyle); i++) { + if (PCB->RouteStyle.array[i].Thick == 0 || + PCB->RouteStyle.array[i].Diameter == 0 || PCB->RouteStyle.array[i].Hole == 0 || PCB->RouteStyle.array[i].Clearance == 0) { Message("You must define proper routing styles\n" "before auto-routing.\n"); return (false); } Index: trunk/src_plugins/hid_gtk/ghid-route-style-selector.c =================================================================== --- trunk/src_plugins/hid_gtk/ghid-route-style-selector.c (revision 2032) +++ trunk/src_plugins/hid_gtk/ghid-route-style-selector.c (revision 2033) @@ -114,7 +114,7 @@ return; } - gtk_entry_set_text(GTK_ENTRY(dialog->name_entry), style->rst->Name); + gtk_entry_set_text(GTK_ENTRY(dialog->name_entry), style->rst->name); ghid_coord_entry_set_value(GHID_COORD_ENTRY(dialog->line_entry), style->rst->Thick); ghid_coord_entry_set_value(GHID_COORD_ENTRY(dialog->via_hole_entry), style->rst->Hole); ghid_coord_entry_set_value(GHID_COORD_ENTRY(dialog->via_size_entry), style->rst->Diameter); @@ -145,6 +145,7 @@ GtkWidget *content_area; GtkWidget *vbox, *hbox, *sub_vbox, *table; GtkWidget *label, *select_box, *check_box; + char *new_name; /* Build dialog */ dialog = gtk_dialog_new_with_buttons(_("Edit Route Styles"), @@ -212,10 +213,16 @@ rst = g_malloc(sizeof *rst); else { rst = style->rst; - free(rst->Name); + *rst->name = '\0'; } - rst->Name = StripWhiteSpaceAndDup(gtk_entry_get_text(GTK_ENTRY(dialog_data.name_entry))); +#warning TODO: doesn't this leak? + new_name = gtk_entry_get_text(GTK_ENTRY(dialog_data.name_entry)); + + while(isspace(*new_name)) new_name++; + strncpy(rst->name, new_name, sizeof(rst->name)-1); + rst->name[sizeof(rst->name)-1] = '0'; + rst->Thick = ghid_coord_entry_get_value(GHID_COORD_ENTRY(dialog_data.line_entry)); rst->Hole = ghid_coord_entry_get_value(GHID_COORD_ENTRY(dialog_data.via_hole_entry)); rst->Diameter = ghid_coord_entry_get_value(GHID_COORD_ENTRY(dialog_data.via_size_entry)); @@ -225,8 +232,8 @@ if (style == NULL) style = ghid_route_style_selector_real_add_route_style(rss, rst, TRUE); else { - gtk_action_set_label(GTK_ACTION(style->action), rst->Name); - gtk_list_store_set(rss->model, &iter, TEXT_COL, rst->Name, -1); + gtk_action_set_label(GTK_ACTION(style->action), rst->name); + gtk_list_store_set(rss->model, &iter, TEXT_COL, rst->name, -1); } /* Cleanup */ @@ -355,7 +362,7 @@ /* Key the route style data with the RouteStyleType it controls */ new_style->rst = data; new_style->temporary = temp; - new_style->action = gtk_radio_action_new(action_name, data->Name, NULL, NULL, action_count); + new_style->action = gtk_radio_action_new(action_name, data->name, NULL, NULL, action_count); gtk_radio_action_set_group(new_style->action, rss->action_radio_group); rss->action_radio_group = gtk_radio_action_get_group(new_style->action); new_style->button = gtk_radio_button_new(rss->button_radio_group); @@ -363,7 +370,7 @@ gtk_activatable_set_related_action(GTK_ACTIVATABLE(new_style->button), GTK_ACTION(new_style->action)); gtk_list_store_append(rss->model, &iter); - gtk_list_store_set(rss->model, &iter, TEXT_COL, data->Name, DATA_COL, new_style, -1); + gtk_list_store_set(rss->model, &iter, TEXT_COL, data->name, DATA_COL, new_style, -1); path = gtk_tree_model_get_path(GTK_TREE_MODEL(rss->model), &iter); new_style->rref = gtk_tree_row_reference_new(GTK_TREE_MODEL(rss->model), path); gtk_tree_path_free(path); Index: trunk/src_plugins/hid_gtk/gui-top-window.c =================================================================== --- trunk/src_plugins/hid_gtk/gui-top-window.c (revision 2032) +++ trunk/src_plugins/hid_gtk/gui-top-window.c (revision 2033) @@ -100,6 +100,7 @@ #include "hid_attrib.h" #include "hid_actions.h" #include "hid_flags.h" +#include "route_style.h" RCSID("$Id$"); @@ -344,8 +345,10 @@ */ void ghid_sync_with_new_layout(void) { - pcb_use_route_style(&PCB->RouteStyle[0]); - ghid_route_style_selector_select_style(GHID_ROUTE_STYLE_SELECTOR(ghidgui->route_style_selector), &PCB->RouteStyle[0]); + if (vtroutestyle_len(&PCB->RouteStyle) > 0) { + pcb_use_route_style(&PCB->RouteStyle.array[0]); + ghid_route_style_selector_select_style(GHID_ROUTE_STYLE_SELECTOR(ghidgui->route_style_selector), &PCB->RouteStyle.array[0]); + } ghid_config_handle_units_changed(); @@ -733,9 +736,9 @@ /*! \brief Called when user clicks OK on route style dialog */ static void route_styles_edited_cb(GHidRouteStyleSelector * rss, gboolean save, gpointer data) { - conf_setf(CFR_DESIGN, "design/routes", -1, "%s", make_route_string(PCB->RouteStyle, NUM_STYLES)); + conf_setf(CFR_DESIGN, "design/routes", -1, "%s", make_route_string(&PCB->RouteStyle)); if (save) - conf_setf(CFR_USER, "design/routes", -1, "%s", make_route_string(PCB->RouteStyle, NUM_STYLES)); + conf_setf(CFR_USER, "design/routes", -1, "%s", make_route_string(&PCB->RouteStyle)); ghid_main_menu_install_route_style_selector (GHID_MAIN_MENU(ghidgui->menu_bar), GHID_ROUTE_STYLE_SELECTOR(ghidgui->route_style_selector)); } @@ -751,8 +754,8 @@ void make_route_style_buttons(GHidRouteStyleSelector * rss) { int i; - for (i = 0; i < NUM_STYLES; ++i) - ghid_route_style_selector_add_route_style(rss, &PCB->RouteStyle[i]); + for (i = 0; i < vtroutestyle_len(&PCB->RouteStyle); ++i) + ghid_route_style_selector_add_route_style(rss, &PCB->RouteStyle.array[i]); g_signal_connect(G_OBJECT(rss), "select_style", G_CALLBACK(route_style_changed_cb), NULL); g_signal_connect(G_OBJECT(rss), "style_edited", G_CALLBACK(route_styles_edited_cb), NULL); } Index: trunk/src_plugins/hid_lesstif/styles.c =================================================================== --- trunk/src_plugins/hid_lesstif/styles.c (revision 2032) +++ trunk/src_plugins/hid_lesstif/styles.c (revision 2033) @@ -52,9 +52,20 @@ static Widget style_dialog = 0; static Widget style_values[SSNUM]; -static Widget style_pb[NUM_STYLES]; -static Widget units_pb[NUM_STYLES]; -static int name_hashes[NUM_STYLES]; + +/* dynamic arrays for styles */ +static int alloced_styles = 0; +static Widget *style_pb; +static Widget *units_pb; +static int *name_hashes; +typedef struct { + Widget *w; +} StyleButtons; + +static StyleButtons *style_button_list = NULL; +static int num_style_buttons = 0; /* number of style_button_list instances (depends on how many times it's placed in the menu) */ +/**/ + static Widget value_form, value_labels, value_texts, units_form; static int local_update = 0; XmString xms_mm, xms_mil; @@ -73,13 +84,6 @@ return h; } -typedef struct { - Widget w[NUM_STYLES]; -} StyleButtons; - -static StyleButtons *style_button_list = 0; -static int num_style_buttons = 0; - static char *value_names[] = { "Thickness", "Diameter", "Hole", "Clearance" }; @@ -125,7 +129,7 @@ int j, n; for (n = 0; n < num_style_buttons; n++) { - for (j = 0; j < NUM_STYLES; j++) + for (j = 0; j < vtroutestyle_len(&PCB->RouteStyle); j++) if (j != i - 1) XmToggleButtonSetState(style_button_list[n].w[j], 0, 0); else @@ -132,7 +136,7 @@ XmToggleButtonSetState(style_button_list[n].w[j], 1, 0); } if (style_dialog) { - for (j = 0; j < NUM_STYLES; j++) + for (j = 0; j < vtroutestyle_len(&PCB->RouteStyle); j++) if (j != i - 1) XmToggleButtonSetState(style_pb[j], 0, 0); else @@ -219,18 +223,20 @@ static void style_name_cb(Widget w, int i, XmToggleButtonCallbackStruct * cbs) { - char *newname = lesstif_prompt_for("New name", PCB->RouteStyle[i].Name); - free(PCB->RouteStyle[i].Name); - PCB->RouteStyle[i].Name = newname; + char *newname = lesstif_prompt_for("New name", PCB->RouteStyle.array[i].name); + strncpy(PCB->RouteStyle.array[i].name, newname, sizeof(PCB->RouteStyle.array[i].name)-1); + PCB->RouteStyle.array[i].name[sizeof(PCB->RouteStyle.array[i].name)-1] = '\0'; + free(newname); + RouteStylesChanged(0, 0, 0, 0); } static void style_set_cb(Widget w, int i, XmToggleButtonCallbackStruct * cbs) { - PCB->RouteStyle[i].Thick = conf_core.design.line_thickness; - PCB->RouteStyle[i].Diameter = conf_core.design.via_thickness; - PCB->RouteStyle[i].Hole = conf_core.design.via_drilling_hole; - PCB->RouteStyle[i].Clearance = conf_core.design.clearance; + PCB->RouteStyle.array[i].Thick = conf_core.design.line_thickness; + PCB->RouteStyle.array[i].Diameter = conf_core.design.via_thickness; + PCB->RouteStyle.array[i].Hole = conf_core.design.via_drilling_hole; + PCB->RouteStyle.array[i].Clearance = conf_core.design.clearance; update_style_buttons(); } @@ -242,13 +248,13 @@ XmToggleButtonSetState(w, 1, 0); return; } - style = PCB->RouteStyle + i; + style = PCB->RouteStyle.array + i; SetLineSize(style->Thick); SetViaSize(style->Diameter, true); SetViaDrillingHole(style->Hole, true); SetClearanceWidth(style->Clearance); if (style_dialog) { - for (j = 0; j < NUM_STYLES; j++) + for (j = 0; j < vtroutestyle_len(&PCB->RouteStyle); j++) if (j != i) XmToggleButtonSetState(style_pb[j], 0, 0); else @@ -258,7 +264,7 @@ else lesstif_update_status_line(); for (n = 0; n < num_style_buttons; n++) { - for (j = 0; j < NUM_STYLES; j++) + for (j = 0; j < vtroutestyle_len(&PCB->RouteStyle); j++) if (j != i) XmToggleButtonSetState(style_button_list[n].w[j], 0, 0); else @@ -295,7 +301,7 @@ stdarg(XmNrightAttachment, XmATTACH_FORM); stdarg(XmNleftAttachment, XmATTACH_WIDGET); stdarg(XmNleftWidget, set); - stdarg(XmNlabelString, XmStringCreatePCB(PCB->RouteStyle[i].Name)); + stdarg(XmNlabelString, XmStringCreatePCB(PCB->RouteStyle.array[i].name)); stdarg(XmNindicatorType, XmONE_OF_MANY); stdarg(XmNalignment, XmALIGNMENT_BEGINNING); pb = XmCreateToggleButton(style_dialog, "style", stdarg_args, stdarg_n); @@ -364,9 +370,9 @@ for (i = 0; i < SSNUM; i++) { style_values[i] = style_value(i); - name_hashes[i] = hash(PCB->RouteStyle[i].Name); + name_hashes[i] = hash(PCB->RouteStyle.array[i].name); } - for (i = 0; i < NUM_STYLES; i++) + for (i = 0; i < vtroutestyle_len(&PCB->RouteStyle); i++) style_pb[i] = style_button(i); update_values(); update_style_buttons(); @@ -378,18 +384,18 @@ static int RouteStylesChanged(int argc, char **argv, Coord x, Coord y) { int i, j, h; - if (!PCB || !PCB->RouteStyle[0].Name) + if (!PCB || vtroutestyle_len(&PCB->RouteStyle) == 0) return 0; update_style_buttons(); if (!style_dialog) return 0; - for (j = 0; j < NUM_STYLES; j++) { - h = hash(PCB->RouteStyle[j].Name); + for (j = 0; j < vtroutestyle_len(&PCB->RouteStyle); j++) { + h = hash(PCB->RouteStyle.array[j].name); if (name_hashes[j] == h) continue; name_hashes[j] = h; stdarg_n = 0; - stdarg(XmNlabelString, XmStringCreatePCB(PCB->RouteStyle[j].Name)); + stdarg(XmNlabelString, XmStringCreatePCB(PCB->RouteStyle.array[j].name)); if (style_dialog) XtSetValues(style_pb[j], stdarg_args, stdarg_n); for (i = 0; i < num_style_buttons; i++) @@ -409,11 +415,17 @@ style_button_list = (StyleButtons *) realloc(style_button_list, s); sb = style_button_list + num_style_buttons - 1; - for (i = 0; i < NUM_STYLES; i++) { + alloced_styles = vtroutestyle_len(&PCB->RouteStyle); + style_pb = realloc(style_pb, sizeof(style_pb[0]) * alloced_styles); + units_pb = realloc(units_pb, sizeof(units_pb[0]) * alloced_styles); + name_hashes = realloc(name_hashes, sizeof(name_hashes[0]) * alloced_styles); + sb->w = realloc(sb->w, sizeof(sb->w[0]) * alloced_styles); + + for (i = 0; i < vtroutestyle_len(&PCB->RouteStyle); i++) { Widget btn; stdarg_n = 0; stdarg(XmNindicatorType, XmONE_OF_MANY); - stdarg(XmNlabelString, XmStringCreatePCB(PCB->RouteStyle[i].Name)); + stdarg(XmNlabelString, XmStringCreatePCB(PCB->RouteStyle.array[i].name)); btn = XmCreateToggleButton(menu, "style", stdarg_args, stdarg_n); XtManageChild(btn); XtAddCallback(btn, XmNvalueChangedCallback, (XtCallbackProc) style_selected, (XtPointer) (size_t) i); Index: trunk/src_plugins/io_pcb/file.c =================================================================== --- trunk/src_plugins/io_pcb/file.c (revision 2032) +++ trunk/src_plugins/io_pcb/file.c (revision 2033) @@ -105,7 +105,9 @@ #include "hid_flags.h" #include "flags.h" #include "attribs.h" +#include "route_style.h" + RCSID("$Id$"); #if !defined(HAS_ATEXIT) && !defined(HAS_ON_EXIT) @@ -241,7 +243,7 @@ */ static void WritePCBDataHeader(FILE * FP) { - Cardinal group; + int group; FlagType pcb_flags; memset(&pcb_flags, 0, sizeof(pcb_flags)); @@ -302,13 +304,17 @@ fprintf(FP, "Flags(%s)\n", pcbflags_to_string(pcb_flags)); fprintf(FP, "Groups(\"%s\")\n", LayerGroupsToString(&PCB->LayerGroups)); fputs("Styles[\"", FP); - for (group = 0; group < NUM_STYLES - 1; group++) - pcb_fprintf(FP, "%s,%mr,%mr,%mr,%mr:", PCB->RouteStyle[group].Name, - PCB->RouteStyle[group].Thick, - PCB->RouteStyle[group].Diameter, PCB->RouteStyle[group].Hole, PCB->RouteStyle[group].Clearance); - pcb_fprintf(FP, "%s,%mr,%mr,%mr,%mr\"]\n\n", PCB->RouteStyle[group].Name, - PCB->RouteStyle[group].Thick, - PCB->RouteStyle[group].Diameter, PCB->RouteStyle[group].Hole, PCB->RouteStyle[group].Clearance); +printf("groups=%d\n", vtroutestyle_len(&PCB->RouteStyle)); + + if (vtroutestyle_len(&PCB->RouteStyle) > 0) { + for (group = 0; group < vtroutestyle_len(&PCB->RouteStyle) - 1; group++) + pcb_fprintf(FP, "%s,%mr,%mr,%mr,%mr:", PCB->RouteStyle.array[group].name, + PCB->RouteStyle.array[group].Thick, + PCB->RouteStyle.array[group].Diameter, PCB->RouteStyle.array[group].Hole, PCB->RouteStyle.array[group].Clearance); + pcb_fprintf(FP, "%s,%mr,%mr,%mr,%mr\"]\n\n", PCB->RouteStyle.array[group].name, + PCB->RouteStyle.array[group].Thick, + PCB->RouteStyle.array[group].Diameter, PCB->RouteStyle.array[group].Hole, PCB->RouteStyle.array[group].Clearance); + } } /* --------------------------------------------------------------------------- Index: trunk/src_plugins/io_pcb/parse_y.c =================================================================== --- trunk/src_plugins/io_pcb/parse_y.c (revision 2032) +++ trunk/src_plugins/io_pcb/parse_y.c (revision 2033) @@ -111,6 +111,7 @@ #include "thermal.h" #include "rats_patch.h" #include "flags.h" +#include "route_style.h" #ifdef HAVE_LIBDMALLOC # include /* see http://dmalloc.com */ @@ -162,7 +163,7 @@ #include "parse_y.h" -#line 166 "parse_y.tab.c" /* yacc.c:339 */ +#line 167 "parse_y.tab.c" /* yacc.c:339 */ # ifndef YY_NULLPTR # if defined __cplusplus && 201103L <= __cplusplus @@ -253,7 +254,7 @@ typedef union YYSTYPE YYSTYPE; union YYSTYPE { -#line 114 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:355 */ +#line 115 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:355 */ int integer; double number; @@ -261,7 +262,7 @@ FlagType flagtype; PLMeasure measure; -#line 265 "parse_y.tab.c" /* yacc.c:355 */ +#line 266 "parse_y.tab.c" /* yacc.c:355 */ }; # define YYSTYPE_IS_TRIVIAL 1 # define YYSTYPE_IS_DECLARED 1 @@ -276,7 +277,7 @@ /* Copy the second part of user declarations. */ -#line 280 "parse_y.tab.c" /* yacc.c:358 */ +#line 281 "parse_y.tab.c" /* yacc.c:358 */ #ifdef short # undef short @@ -578,28 +579,28 @@ /* YYRLINE[YYN] -- Source line where rule number YYN was defined. */ static const yytype_uint16 yyrline[] = { - 0, 141, 141, 142, 143, 144, 168, 168, 226, 226, - 237, 237, 256, 257, 262, 262, 302, 304, 334, 340, - 346, 375, 376, 377, 380, 388, 403, 437, 443, 449, - 465, 467, 492, 494, 525, 527, 528, 529, 533, 543, - 554, 581, 585, 590, 618, 622, 666, 675, 684, 688, - 689, 693, 694, 698, 699, 699, 700, 701, 703, 703, - 710, 714, 715, 716, 717, 718, 754, 764, 775, 785, - 795, 831, 836, 868, 867, 895, 896, 900, 901, 905, - 906, 907, 908, 909, 910, 912, 917, 918, 919, 920, - 920, 921, 951, 960, 969, 1017, 1026, 1035, 1072, 1082, - 1100, 1150, 1149, 1188, 1190, 1195, 1194, 1201, 1203, 1208, - 1212, 1272, 1273, 1274, 1275, 1276, 1284, 1283, 1302, 1301, - 1320, 1319, 1340, 1338, 1362, 1360, 1441, 1442, 1446, 1447, - 1448, 1449, 1450, 1452, 1457, 1462, 1467, 1472, 1477, 1482, - 1482, 1486, 1487, 1491, 1492, 1493, 1494, 1496, 1502, 1509, - 1514, 1519, 1519, 1560, 1572, 1584, 1595, 1611, 1665, 1679, - 1692, 1703, 1714, 1715, 1719, 1720, 1742, 1744, 1760, 1779, - 1780, 1783, 1785, 1786, 1807, 1814, 1830, 1831, 1835, 1840, - 1841, 1845, 1846, 1870, 1869, 1879, 1880, 1884, 1885, 1904, - 1921, 1922, 1926, 1931, 1932, 1936, 1937, 1952, 1953, 1954, - 1981, 1989, 1990, 1994, 1995, 2000, 2001, 2002, 2003, 2004, - 2005, 2006, 2007, 2008, 2009 + 0, 142, 142, 143, 144, 145, 169, 169, 227, 227, + 238, 238, 257, 258, 263, 263, 303, 305, 335, 341, + 347, 376, 377, 378, 381, 389, 404, 438, 444, 450, + 466, 468, 493, 495, 526, 528, 529, 530, 534, 544, + 555, 582, 586, 591, 619, 623, 667, 676, 685, 689, + 690, 694, 695, 699, 700, 700, 701, 702, 704, 704, + 711, 715, 716, 717, 718, 719, 755, 765, 776, 786, + 796, 832, 837, 869, 868, 896, 897, 901, 902, 906, + 907, 908, 909, 910, 911, 913, 918, 919, 920, 921, + 921, 922, 952, 961, 970, 1018, 1027, 1036, 1073, 1083, + 1101, 1151, 1150, 1189, 1191, 1196, 1195, 1202, 1204, 1209, + 1213, 1273, 1274, 1275, 1276, 1277, 1285, 1284, 1303, 1302, + 1321, 1320, 1341, 1339, 1363, 1361, 1442, 1443, 1447, 1448, + 1449, 1450, 1451, 1453, 1458, 1463, 1468, 1473, 1478, 1483, + 1483, 1487, 1488, 1492, 1493, 1494, 1495, 1497, 1503, 1510, + 1515, 1520, 1520, 1561, 1573, 1585, 1596, 1612, 1666, 1680, + 1693, 1704, 1715, 1716, 1720, 1721, 1743, 1745, 1761, 1780, + 1781, 1784, 1786, 1787, 1808, 1815, 1831, 1832, 1836, 1841, + 1842, 1846, 1847, 1871, 1870, 1880, 1881, 1885, 1886, 1905, + 1922, 1923, 1927, 1932, 1933, 1937, 1938, 1953, 1954, 1955, + 1982, 1990, 1991, 1995, 1996, 2001, 2002, 2003, 2004, 2005, + 2006, 2007, 2008, 2009, 2010 }; #endif @@ -1776,13 +1777,13 @@ switch (yyn) { case 5: -#line 144 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ +#line 145 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ { YYABORT; } -#line 1782 "parse_y.tab.c" /* yacc.c:1646 */ +#line 1783 "parse_y.tab.c" /* yacc.c:1646 */ break; case 6: -#line 168 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ +#line 169 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ { /* reset flags for 'used layers'; * init font and data pointers @@ -1803,11 +1804,11 @@ yyPCB->NetlistPatches = yyPCB->NetlistPatchLast = NULL; layer_group_string = NULL; } -#line 1807 "parse_y.tab.c" /* yacc.c:1646 */ +#line 1808 "parse_y.tab.c" /* yacc.c:1646 */ break; case 7: -#line 202 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ +#line 203 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ { PCBTypePtr pcb_save = PCB; @@ -1831,28 +1832,28 @@ ENDALL_LOOP; PCB = pcb_save; } -#line 1835 "parse_y.tab.c" /* yacc.c:1646 */ +#line 1836 "parse_y.tab.c" /* yacc.c:1646 */ break; case 8: -#line 226 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ +#line 227 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ { PreLoadElementPCB (); layer_group_string = NULL; } -#line 1842 "parse_y.tab.c" /* yacc.c:1646 */ +#line 1843 "parse_y.tab.c" /* yacc.c:1646 */ break; case 9: -#line 229 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ +#line 230 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ { LayerFlag[0] = true; LayerFlag[1] = true; yyData->LayerN = 2; PostLoadElementPCB (); } -#line 1852 "parse_y.tab.c" /* yacc.c:1646 */ +#line 1853 "parse_y.tab.c" /* yacc.c:1646 */ break; case 10: -#line 237 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ +#line 238 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ { /* reset flags for 'used layers'; * init font and data pointers @@ -1868,11 +1869,11 @@ LayerFlag[i] = false; yyData->LayerN = 0; } -#line 1872 "parse_y.tab.c" /* yacc.c:1646 */ +#line 1873 "parse_y.tab.c" /* yacc.c:1646 */ break; case 14: -#line 262 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ +#line 263 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ { /* mark all symbols invalid */ int i; @@ -1887,20 +1888,20 @@ free (yyFont->Symbol[i].Line); bzero(yyFont->Symbol, sizeof(yyFont->Symbol)); } -#line 1891 "parse_y.tab.c" /* yacc.c:1646 */ +#line 1892 "parse_y.tab.c" /* yacc.c:1646 */ break; case 15: -#line 277 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ +#line 278 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ { yyFont->Valid = true; SetFontInfo(yyFont); } -#line 1900 "parse_y.tab.c" /* yacc.c:1646 */ +#line 1901 "parse_y.tab.c" /* yacc.c:1646 */ break; case 17: -#line 305 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ +#line 306 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ { if (check_file_version ((yyvsp[-1].integer)) != 0) { @@ -1907,51 +1908,51 @@ YYABORT; } } -#line 1911 "parse_y.tab.c" /* yacc.c:1646 */ +#line 1912 "parse_y.tab.c" /* yacc.c:1646 */ break; case 18: -#line 335 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ +#line 336 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ { yyPCB->Name = (yyvsp[-1].string); yyPCB->MaxWidth = MAX_COORD; yyPCB->MaxHeight = MAX_COORD; } -#line 1921 "parse_y.tab.c" /* yacc.c:1646 */ +#line 1922 "parse_y.tab.c" /* yacc.c:1646 */ break; case 19: -#line 341 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ +#line 342 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ { yyPCB->Name = (yyvsp[-3].string); yyPCB->MaxWidth = OU ((yyvsp[-2].measure)); yyPCB->MaxHeight = OU ((yyvsp[-1].measure)); } -#line 1931 "parse_y.tab.c" /* yacc.c:1646 */ +#line 1932 "parse_y.tab.c" /* yacc.c:1646 */ break; case 20: -#line 347 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ +#line 348 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ { yyPCB->Name = (yyvsp[-3].string); yyPCB->MaxWidth = NU ((yyvsp[-2].measure)); yyPCB->MaxHeight = NU ((yyvsp[-1].measure)); } -#line 1941 "parse_y.tab.c" /* yacc.c:1646 */ +#line 1942 "parse_y.tab.c" /* yacc.c:1646 */ break; case 24: -#line 381 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ +#line 382 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ { yyPCB->Grid = OU ((yyvsp[-3].measure)); yyPCB->GridOffsetX = OU ((yyvsp[-2].measure)); yyPCB->GridOffsetY = OU ((yyvsp[-1].measure)); } -#line 1951 "parse_y.tab.c" /* yacc.c:1646 */ +#line 1952 "parse_y.tab.c" /* yacc.c:1646 */ break; case 25: -#line 389 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ +#line 390 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ { yyPCB->Grid = OU ((yyvsp[-4].measure)); yyPCB->GridOffsetX = OU ((yyvsp[-3].measure)); @@ -1963,11 +1964,11 @@ conf_set(CFR_DESIGN, "editor/draw_grid", -1, "false", POL_OVERWRITE); } } -#line 1967 "parse_y.tab.c" /* yacc.c:1646 */ +#line 1968 "parse_y.tab.c" /* yacc.c:1646 */ break; case 26: -#line 404 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ +#line 405 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ { yyPCB->Grid = NU ((yyvsp[-4].measure)); yyPCB->GridOffsetX = NU ((yyvsp[-3].measure)); @@ -1979,48 +1980,48 @@ conf_set(CFR_DESIGN, "editor/draw_grid", -1, "false", POL_OVERWRITE); } } -#line 1983 "parse_y.tab.c" /* yacc.c:1646 */ +#line 1984 "parse_y.tab.c" /* yacc.c:1646 */ break; case 27: -#line 438 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ +#line 439 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ { yyPCB->CursorX = OU ((yyvsp[-3].measure)); yyPCB->CursorY = OU ((yyvsp[-2].measure)); yyPCB->Zoom = (yyvsp[-1].number)*2; } -#line 1993 "parse_y.tab.c" /* yacc.c:1646 */ +#line 1994 "parse_y.tab.c" /* yacc.c:1646 */ break; case 28: -#line 444 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ +#line 445 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ { yyPCB->CursorX = NU ((yyvsp[-3].measure)); yyPCB->CursorY = NU ((yyvsp[-2].measure)); yyPCB->Zoom = (yyvsp[-1].number); } -#line 2003 "parse_y.tab.c" /* yacc.c:1646 */ +#line 2004 "parse_y.tab.c" /* yacc.c:1646 */ break; case 31: -#line 468 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ +#line 469 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ { /* Read in cmil^2 for now; in future this should be a noop. */ yyPCB->IsleArea = MIL_TO_COORD (MIL_TO_COORD ((yyvsp[-1].number)) / 100.0) / 100.0; } -#line 2012 "parse_y.tab.c" /* yacc.c:1646 */ +#line 2013 "parse_y.tab.c" /* yacc.c:1646 */ break; case 33: -#line 495 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ +#line 496 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ { yyPCB->ThermScale = (yyvsp[-1].number); } -#line 2020 "parse_y.tab.c" /* yacc.c:1646 */ +#line 2021 "parse_y.tab.c" /* yacc.c:1646 */ break; case 38: -#line 534 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ +#line 535 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ { yyPCB->Bloat = NU ((yyvsp[-3].measure)); yyPCB->Shrink = NU ((yyvsp[-2].measure)); @@ -2027,11 +2028,11 @@ yyPCB->minWid = NU ((yyvsp[-1].measure)); yyPCB->minRing = NU ((yyvsp[-1].measure)); } -#line 2031 "parse_y.tab.c" /* yacc.c:1646 */ +#line 2032 "parse_y.tab.c" /* yacc.c:1646 */ break; case 39: -#line 544 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ +#line 545 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ { yyPCB->Bloat = NU ((yyvsp[-4].measure)); yyPCB->Shrink = NU ((yyvsp[-3].measure)); @@ -2039,11 +2040,11 @@ yyPCB->minSlk = NU ((yyvsp[-1].measure)); yyPCB->minRing = NU ((yyvsp[-2].measure)); } -#line 2043 "parse_y.tab.c" /* yacc.c:1646 */ +#line 2044 "parse_y.tab.c" /* yacc.c:1646 */ break; case 40: -#line 555 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ +#line 556 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ { yyPCB->Bloat = NU ((yyvsp[-6].measure)); yyPCB->Shrink = NU ((yyvsp[-5].measure)); @@ -2052,38 +2053,38 @@ yyPCB->minDrill = NU ((yyvsp[-2].measure)); yyPCB->minRing = NU ((yyvsp[-1].measure)); } -#line 2056 "parse_y.tab.c" /* yacc.c:1646 */ +#line 2057 "parse_y.tab.c" /* yacc.c:1646 */ break; case 41: -#line 582 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ +#line 583 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ { yy_pcb_flags = MakeFlags ((yyvsp[-1].integer) & PCB_FLAGS); } -#line 2064 "parse_y.tab.c" /* yacc.c:1646 */ +#line 2065 "parse_y.tab.c" /* yacc.c:1646 */ break; case 42: -#line 586 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ +#line 587 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ { yy_pcb_flags = string_to_pcbflags ((yyvsp[-1].string), yyerror); free((yyvsp[-1].string)); } -#line 2073 "parse_y.tab.c" /* yacc.c:1646 */ +#line 2074 "parse_y.tab.c" /* yacc.c:1646 */ break; case 44: -#line 619 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ +#line 620 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ { layer_group_string = (yyvsp[-1].string); } -#line 2081 "parse_y.tab.c" /* yacc.c:1646 */ +#line 2082 "parse_y.tab.c" /* yacc.c:1646 */ break; case 46: -#line 667 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ +#line 668 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ { - if (ParseRouteString((yyvsp[-1].string), &yyPCB->RouteStyle[0], "mil")) + if (ParseRouteString((yyvsp[-1].string), &yyPCB->RouteStyle, "mil")) { Message("illegal route-style string\n"); YYABORT; @@ -2090,13 +2091,13 @@ } free((yyvsp[-1].string)); } -#line 2094 "parse_y.tab.c" /* yacc.c:1646 */ +#line 2095 "parse_y.tab.c" /* yacc.c:1646 */ break; case 47: -#line 676 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ +#line 677 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ { - if (ParseRouteString((yyvsp[-1].string), &yyPCB->RouteStyle[0], "cmil")) + if (ParseRouteString((yyvsp[-1].string), &yyPCB->RouteStyle, "cmil")) { Message("illegal route-style string\n"); YYABORT; @@ -2103,17 +2104,17 @@ } free((yyvsp[-1].string)); } -#line 2107 "parse_y.tab.c" /* yacc.c:1646 */ +#line 2108 "parse_y.tab.c" /* yacc.c:1646 */ break; case 54: -#line 699 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ +#line 700 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ { attr_list = & yyPCB->Attributes; } -#line 2113 "parse_y.tab.c" /* yacc.c:1646 */ +#line 2114 "parse_y.tab.c" /* yacc.c:1646 */ break; case 58: -#line 703 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ +#line 704 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ { /* clear pointer to force memory allocation by * the appropriate subroutine @@ -2120,57 +2121,57 @@ */ yyElement = NULL; } -#line 2124 "parse_y.tab.c" /* yacc.c:1646 */ +#line 2125 "parse_y.tab.c" /* yacc.c:1646 */ break; case 60: -#line 710 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ +#line 711 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ { YYABORT; } -#line 2130 "parse_y.tab.c" /* yacc.c:1646 */ +#line 2131 "parse_y.tab.c" /* yacc.c:1646 */ break; case 66: -#line 755 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ +#line 756 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ { CreateNewVia(yyData, NU ((yyvsp[-8].measure)), NU ((yyvsp[-7].measure)), NU ((yyvsp[-6].measure)), NU ((yyvsp[-5].measure)), NU ((yyvsp[-4].measure)), NU ((yyvsp[-3].measure)), (yyvsp[-2].string), (yyvsp[-1].flagtype)); free ((yyvsp[-2].string)); } -#line 2140 "parse_y.tab.c" /* yacc.c:1646 */ +#line 2141 "parse_y.tab.c" /* yacc.c:1646 */ break; case 67: -#line 765 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ +#line 766 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ { CreateNewVia(yyData, OU ((yyvsp[-8].measure)), OU ((yyvsp[-7].measure)), OU ((yyvsp[-6].measure)), OU ((yyvsp[-5].measure)), OU ((yyvsp[-4].measure)), OU ((yyvsp[-3].measure)), (yyvsp[-2].string), OldFlags((yyvsp[-1].integer))); free ((yyvsp[-2].string)); } -#line 2150 "parse_y.tab.c" /* yacc.c:1646 */ +#line 2151 "parse_y.tab.c" /* yacc.c:1646 */ break; case 68: -#line 776 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ +#line 777 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ { CreateNewVia(yyData, OU ((yyvsp[-7].measure)), OU ((yyvsp[-6].measure)), OU ((yyvsp[-5].measure)), OU ((yyvsp[-4].measure)), OU ((yyvsp[-5].measure)) + OU((yyvsp[-4].measure)), OU ((yyvsp[-3].measure)), (yyvsp[-2].string), OldFlags((yyvsp[-1].integer))); free ((yyvsp[-2].string)); } -#line 2160 "parse_y.tab.c" /* yacc.c:1646 */ +#line 2161 "parse_y.tab.c" /* yacc.c:1646 */ break; case 69: -#line 786 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ +#line 787 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ { CreateNewVia(yyData, OU ((yyvsp[-6].measure)), OU ((yyvsp[-5].measure)), OU ((yyvsp[-4].measure)), 2*GROUNDPLANEFRAME, OU((yyvsp[-4].measure)) + 2*MASKFRAME, OU ((yyvsp[-3].measure)), (yyvsp[-2].string), OldFlags((yyvsp[-1].integer))); free ((yyvsp[-2].string)); } -#line 2170 "parse_y.tab.c" /* yacc.c:1646 */ +#line 2171 "parse_y.tab.c" /* yacc.c:1646 */ break; case 70: -#line 796 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ +#line 797 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ { Coord hole = (OU((yyvsp[-3].measure)) * DEFAULT_DRILLINGHOLE); @@ -2183,29 +2184,29 @@ OU((yyvsp[-3].measure)) + 2*MASKFRAME, hole, (yyvsp[-2].string), OldFlags((yyvsp[-1].integer))); free ((yyvsp[-2].string)); } -#line 2187 "parse_y.tab.c" /* yacc.c:1646 */ +#line 2188 "parse_y.tab.c" /* yacc.c:1646 */ break; case 71: -#line 832 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ +#line 833 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ { CreateNewRat(yyData, NU ((yyvsp[-7].measure)), NU ((yyvsp[-6].measure)), NU ((yyvsp[-4].measure)), NU ((yyvsp[-3].measure)), (yyvsp[-5].integer), (yyvsp[-2].integer), conf_core.appearance.rat_thickness, (yyvsp[-1].flagtype)); } -#line 2196 "parse_y.tab.c" /* yacc.c:1646 */ +#line 2197 "parse_y.tab.c" /* yacc.c:1646 */ break; case 72: -#line 837 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ +#line 838 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ { CreateNewRat(yyData, OU ((yyvsp[-7].measure)), OU ((yyvsp[-6].measure)), OU ((yyvsp[-4].measure)), OU ((yyvsp[-3].measure)), (yyvsp[-5].integer), (yyvsp[-2].integer), conf_core.appearance.rat_thickness, OldFlags((yyvsp[-1].integer))); } -#line 2205 "parse_y.tab.c" /* yacc.c:1646 */ +#line 2206 "parse_y.tab.c" /* yacc.c:1646 */ break; case 73: -#line 868 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ +#line 869 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ { if ((yyvsp[-4].integer) <= 0 || (yyvsp[-4].integer) > MAX_LAYER + 2) { @@ -2229,44 +2230,44 @@ if ((yyvsp[-2].string) != NULL) free((yyvsp[-2].string)); } -#line 2233 "parse_y.tab.c" /* yacc.c:1646 */ +#line 2234 "parse_y.tab.c" /* yacc.c:1646 */ break; case 85: -#line 913 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ +#line 914 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ { CreateNewPolygonFromRectangle(Layer, OU ((yyvsp[-5].measure)), OU ((yyvsp[-4].measure)), OU ((yyvsp[-5].measure)) + OU ((yyvsp[-3].measure)), OU ((yyvsp[-4].measure)) + OU ((yyvsp[-2].measure)), OldFlags((yyvsp[-1].integer))); } -#line 2242 "parse_y.tab.c" /* yacc.c:1646 */ +#line 2243 "parse_y.tab.c" /* yacc.c:1646 */ break; case 89: -#line 920 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ +#line 921 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ { attr_list = & Layer->Attributes; } -#line 2248 "parse_y.tab.c" /* yacc.c:1646 */ +#line 2249 "parse_y.tab.c" /* yacc.c:1646 */ break; case 92: -#line 952 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ +#line 953 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ { CreateNewLineOnLayer(Layer, NU ((yyvsp[-7].measure)), NU ((yyvsp[-6].measure)), NU ((yyvsp[-5].measure)), NU ((yyvsp[-4].measure)), NU ((yyvsp[-3].measure)), NU ((yyvsp[-2].measure)), (yyvsp[-1].flagtype)); } -#line 2257 "parse_y.tab.c" /* yacc.c:1646 */ +#line 2258 "parse_y.tab.c" /* yacc.c:1646 */ break; case 93: -#line 961 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ +#line 962 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ { CreateNewLineOnLayer(Layer, OU ((yyvsp[-7].measure)), OU ((yyvsp[-6].measure)), OU ((yyvsp[-5].measure)), OU ((yyvsp[-4].measure)), OU ((yyvsp[-3].measure)), OU ((yyvsp[-2].measure)), OldFlags((yyvsp[-1].integer))); } -#line 2266 "parse_y.tab.c" /* yacc.c:1646 */ +#line 2267 "parse_y.tab.c" /* yacc.c:1646 */ break; case 94: -#line 970 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ +#line 971 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ { /* eliminate old-style rat-lines */ if ((IV ((yyvsp[-1].measure)) & RATFLAG) == 0) @@ -2273,48 +2274,48 @@ CreateNewLineOnLayer(Layer, OU ((yyvsp[-6].measure)), OU ((yyvsp[-5].measure)), OU ((yyvsp[-4].measure)), OU ((yyvsp[-3].measure)), OU ((yyvsp[-2].measure)), 200*GROUNDPLANEFRAME, OldFlags(IV ((yyvsp[-1].measure)))); } -#line 2277 "parse_y.tab.c" /* yacc.c:1646 */ +#line 2278 "parse_y.tab.c" /* yacc.c:1646 */ break; case 95: -#line 1018 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ +#line 1019 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ { CreateNewArcOnLayer(Layer, NU ((yyvsp[-9].measure)), NU ((yyvsp[-8].measure)), NU ((yyvsp[-7].measure)), NU ((yyvsp[-6].measure)), (yyvsp[-3].number), (yyvsp[-2].number), NU ((yyvsp[-5].measure)), NU ((yyvsp[-4].measure)), (yyvsp[-1].flagtype)); } -#line 2286 "parse_y.tab.c" /* yacc.c:1646 */ +#line 2287 "parse_y.tab.c" /* yacc.c:1646 */ break; case 96: -#line 1027 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ +#line 1028 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ { CreateNewArcOnLayer(Layer, OU ((yyvsp[-9].measure)), OU ((yyvsp[-8].measure)), OU ((yyvsp[-7].measure)), OU ((yyvsp[-6].measure)), (yyvsp[-3].number), (yyvsp[-2].number), OU ((yyvsp[-5].measure)), OU ((yyvsp[-4].measure)), OldFlags((yyvsp[-1].integer))); } -#line 2295 "parse_y.tab.c" /* yacc.c:1646 */ +#line 2296 "parse_y.tab.c" /* yacc.c:1646 */ break; case 97: -#line 1036 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ +#line 1037 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ { CreateNewArcOnLayer(Layer, OU ((yyvsp[-8].measure)), OU ((yyvsp[-7].measure)), OU ((yyvsp[-6].measure)), OU ((yyvsp[-6].measure)), IV ((yyvsp[-3].measure)), (yyvsp[-2].number), OU ((yyvsp[-4].measure)), 200*GROUNDPLANEFRAME, OldFlags((yyvsp[-1].integer))); } -#line 2304 "parse_y.tab.c" /* yacc.c:1646 */ +#line 2305 "parse_y.tab.c" /* yacc.c:1646 */ break; case 98: -#line 1073 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ +#line 1074 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ { /* use a default scale of 100% */ CreateNewText(Layer,yyFont,OU ((yyvsp[-5].measure)), OU ((yyvsp[-4].measure)), (yyvsp[-3].number), 100, (yyvsp[-2].string), OldFlags((yyvsp[-1].integer))); free ((yyvsp[-2].string)); } -#line 2314 "parse_y.tab.c" /* yacc.c:1646 */ +#line 2315 "parse_y.tab.c" /* yacc.c:1646 */ break; case 99: -#line 1083 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ +#line 1084 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ { if ((yyvsp[-1].integer) & ONSILKFLAG) { @@ -2329,11 +2330,11 @@ OldFlags((yyvsp[-1].integer))); free ((yyvsp[-2].string)); } -#line 2333 "parse_y.tab.c" /* yacc.c:1646 */ +#line 2334 "parse_y.tab.c" /* yacc.c:1646 */ break; case 100: -#line 1101 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ +#line 1102 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ { /* FIXME: shouldn't know about .f */ /* I don't think this matters because anything with hi_format @@ -2353,19 +2354,19 @@ CreateNewText(Layer, yyFont, NU ((yyvsp[-6].measure)), NU ((yyvsp[-5].measure)), (yyvsp[-4].number), (yyvsp[-3].number), (yyvsp[-2].string), (yyvsp[-1].flagtype)); free ((yyvsp[-2].string)); } -#line 2357 "parse_y.tab.c" /* yacc.c:1646 */ +#line 2358 "parse_y.tab.c" /* yacc.c:1646 */ break; case 101: -#line 1150 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ +#line 1151 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ { Polygon = CreateNewPolygon(Layer, (yyvsp[-2].flagtype)); } -#line 2365 "parse_y.tab.c" /* yacc.c:1646 */ +#line 2366 "parse_y.tab.c" /* yacc.c:1646 */ break; case 102: -#line 1155 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ +#line 1156 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ { Cardinal contour, contour_start, contour_end; bool bad_contour_found = false; @@ -2397,35 +2398,35 @@ r_insert_entry (Layer->polygon_tree, (BoxType *) Polygon, 0); } } -#line 2401 "parse_y.tab.c" /* yacc.c:1646 */ +#line 2402 "parse_y.tab.c" /* yacc.c:1646 */ break; case 105: -#line 1195 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ +#line 1196 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ { CreateNewHoleInPolygon (Polygon); } -#line 2409 "parse_y.tab.c" /* yacc.c:1646 */ +#line 2410 "parse_y.tab.c" /* yacc.c:1646 */ break; case 109: -#line 1209 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ +#line 1210 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ { CreateNewPointInPolygon(Polygon, OU ((yyvsp[-2].measure)), OU ((yyvsp[-1].measure))); } -#line 2417 "parse_y.tab.c" /* yacc.c:1646 */ +#line 2418 "parse_y.tab.c" /* yacc.c:1646 */ break; case 110: -#line 1213 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ +#line 1214 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ { CreateNewPointInPolygon(Polygon, NU ((yyvsp[-2].measure)), NU ((yyvsp[-1].measure))); } -#line 2425 "parse_y.tab.c" /* yacc.c:1646 */ +#line 2426 "parse_y.tab.c" /* yacc.c:1646 */ break; case 116: -#line 1284 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ +#line 1285 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ { yyElement = CreateNewElement(yyData, yyElement, yyFont, NoFlags(), (yyvsp[-6].string), (yyvsp[-5].string), NULL, OU ((yyvsp[-4].measure)), OU ((yyvsp[-3].measure)), (yyvsp[-2].integer), 100, NoFlags(), false); @@ -2433,19 +2434,19 @@ free ((yyvsp[-5].string)); pin_num = 1; } -#line 2437 "parse_y.tab.c" /* yacc.c:1646 */ +#line 2438 "parse_y.tab.c" /* yacc.c:1646 */ break; case 117: -#line 1292 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ +#line 1293 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ { SetElementBoundingBox(yyData, yyElement, yyFont); } -#line 2445 "parse_y.tab.c" /* yacc.c:1646 */ +#line 2446 "parse_y.tab.c" /* yacc.c:1646 */ break; case 118: -#line 1302 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ +#line 1303 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ { yyElement = CreateNewElement(yyData, yyElement, yyFont, OldFlags((yyvsp[-9].integer)), (yyvsp[-8].string), (yyvsp[-7].string), NULL, OU ((yyvsp[-6].measure)), OU ((yyvsp[-5].measure)), IV ((yyvsp[-4].measure)), IV ((yyvsp[-3].measure)), OldFlags((yyvsp[-2].integer)), false); @@ -2453,19 +2454,19 @@ free ((yyvsp[-7].string)); pin_num = 1; } -#line 2457 "parse_y.tab.c" /* yacc.c:1646 */ +#line 2458 "parse_y.tab.c" /* yacc.c:1646 */ break; case 119: -#line 1310 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ +#line 1311 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ { SetElementBoundingBox(yyData, yyElement, yyFont); } -#line 2465 "parse_y.tab.c" /* yacc.c:1646 */ +#line 2466 "parse_y.tab.c" /* yacc.c:1646 */ break; case 120: -#line 1320 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ +#line 1321 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ { yyElement = CreateNewElement(yyData, yyElement, yyFont, OldFlags((yyvsp[-10].integer)), (yyvsp[-9].string), (yyvsp[-8].string), (yyvsp[-7].string), OU ((yyvsp[-6].measure)), OU ((yyvsp[-5].measure)), IV ((yyvsp[-4].measure)), IV ((yyvsp[-3].measure)), OldFlags((yyvsp[-2].integer)), false); @@ -2474,19 +2475,19 @@ free ((yyvsp[-7].string)); pin_num = 1; } -#line 2478 "parse_y.tab.c" /* yacc.c:1646 */ +#line 2479 "parse_y.tab.c" /* yacc.c:1646 */ break; case 121: -#line 1329 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ +#line 1330 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ { SetElementBoundingBox(yyData, yyElement, yyFont); } -#line 2486 "parse_y.tab.c" /* yacc.c:1646 */ +#line 2487 "parse_y.tab.c" /* yacc.c:1646 */ break; case 122: -#line 1340 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ +#line 1341 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ { yyElement = CreateNewElement(yyData, yyElement, yyFont, OldFlags((yyvsp[-12].integer)), (yyvsp[-11].string), (yyvsp[-10].string), (yyvsp[-9].string), OU ((yyvsp[-8].measure)) + OU ((yyvsp[-6].measure)), OU ((yyvsp[-7].measure)) + OU ((yyvsp[-5].measure)), @@ -2497,19 +2498,19 @@ free ((yyvsp[-10].string)); free ((yyvsp[-9].string)); } -#line 2501 "parse_y.tab.c" /* yacc.c:1646 */ +#line 2502 "parse_y.tab.c" /* yacc.c:1646 */ break; case 123: -#line 1351 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ +#line 1352 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ { SetElementBoundingBox(yyData, yyElement, yyFont); } -#line 2509 "parse_y.tab.c" /* yacc.c:1646 */ +#line 2510 "parse_y.tab.c" /* yacc.c:1646 */ break; case 124: -#line 1362 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ +#line 1363 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ { yyElement = CreateNewElement(yyData, yyElement, yyFont, (yyvsp[-12].flagtype), (yyvsp[-11].string), (yyvsp[-10].string), (yyvsp[-9].string), NU ((yyvsp[-8].measure)) + NU ((yyvsp[-6].measure)), NU ((yyvsp[-7].measure)) + NU ((yyvsp[-5].measure)), @@ -2520,119 +2521,119 @@ free ((yyvsp[-10].string)); free ((yyvsp[-9].string)); } -#line 2524 "parse_y.tab.c" /* yacc.c:1646 */ +#line 2525 "parse_y.tab.c" /* yacc.c:1646 */ break; case 125: -#line 1373 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ +#line 1374 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ { SetElementBoundingBox(yyData, yyElement, yyFont); } -#line 2532 "parse_y.tab.c" /* yacc.c:1646 */ +#line 2533 "parse_y.tab.c" /* yacc.c:1646 */ break; case 133: -#line 1453 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ +#line 1454 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ { CreateNewLineInElement(yyElement, NU ((yyvsp[-5].measure)), NU ((yyvsp[-4].measure)), NU ((yyvsp[-3].measure)), NU ((yyvsp[-2].measure)), NU ((yyvsp[-1].measure))); } -#line 2540 "parse_y.tab.c" /* yacc.c:1646 */ +#line 2541 "parse_y.tab.c" /* yacc.c:1646 */ break; case 134: -#line 1458 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ +#line 1459 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ { CreateNewLineInElement(yyElement, OU ((yyvsp[-5].measure)), OU ((yyvsp[-4].measure)), OU ((yyvsp[-3].measure)), OU ((yyvsp[-2].measure)), OU ((yyvsp[-1].measure))); } -#line 2548 "parse_y.tab.c" /* yacc.c:1646 */ +#line 2549 "parse_y.tab.c" /* yacc.c:1646 */ break; case 135: -#line 1463 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ +#line 1464 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ { CreateNewArcInElement(yyElement, NU ((yyvsp[-7].measure)), NU ((yyvsp[-6].measure)), NU ((yyvsp[-5].measure)), NU ((yyvsp[-4].measure)), (yyvsp[-3].number), (yyvsp[-2].number), NU ((yyvsp[-1].measure))); } -#line 2556 "parse_y.tab.c" /* yacc.c:1646 */ +#line 2557 "parse_y.tab.c" /* yacc.c:1646 */ break; case 136: -#line 1468 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ +#line 1469 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ { CreateNewArcInElement(yyElement, OU ((yyvsp[-7].measure)), OU ((yyvsp[-6].measure)), OU ((yyvsp[-5].measure)), OU ((yyvsp[-4].measure)), (yyvsp[-3].number), (yyvsp[-2].number), OU ((yyvsp[-1].measure))); } -#line 2564 "parse_y.tab.c" /* yacc.c:1646 */ +#line 2565 "parse_y.tab.c" /* yacc.c:1646 */ break; case 137: -#line 1473 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ +#line 1474 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ { yyElement->MarkX = NU ((yyvsp[-2].measure)); yyElement->MarkY = NU ((yyvsp[-1].measure)); } -#line 2573 "parse_y.tab.c" /* yacc.c:1646 */ +#line 2574 "parse_y.tab.c" /* yacc.c:1646 */ break; case 138: -#line 1478 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ +#line 1479 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ { yyElement->MarkX = OU ((yyvsp[-2].measure)); yyElement->MarkY = OU ((yyvsp[-1].measure)); } -#line 2582 "parse_y.tab.c" /* yacc.c:1646 */ +#line 2583 "parse_y.tab.c" /* yacc.c:1646 */ break; case 139: -#line 1482 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ +#line 1483 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ { attr_list = & yyElement->Attributes; } -#line 2588 "parse_y.tab.c" /* yacc.c:1646 */ +#line 2589 "parse_y.tab.c" /* yacc.c:1646 */ break; case 147: -#line 1497 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ +#line 1498 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ { CreateNewLineInElement(yyElement, NU ((yyvsp[-5].measure)) + yyElement->MarkX, NU ((yyvsp[-4].measure)) + yyElement->MarkY, NU ((yyvsp[-3].measure)) + yyElement->MarkX, NU ((yyvsp[-2].measure)) + yyElement->MarkY, NU ((yyvsp[-1].measure))); } -#line 2598 "parse_y.tab.c" /* yacc.c:1646 */ +#line 2599 "parse_y.tab.c" /* yacc.c:1646 */ break; case 148: -#line 1503 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ +#line 1504 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ { CreateNewLineInElement(yyElement, OU ((yyvsp[-5].measure)) + yyElement->MarkX, OU ((yyvsp[-4].measure)) + yyElement->MarkY, OU ((yyvsp[-3].measure)) + yyElement->MarkX, OU ((yyvsp[-2].measure)) + yyElement->MarkY, OU ((yyvsp[-1].measure))); } -#line 2608 "parse_y.tab.c" /* yacc.c:1646 */ +#line 2609 "parse_y.tab.c" /* yacc.c:1646 */ break; case 149: -#line 1510 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ +#line 1511 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ { CreateNewArcInElement(yyElement, NU ((yyvsp[-7].measure)) + yyElement->MarkX, NU ((yyvsp[-6].measure)) + yyElement->MarkY, NU ((yyvsp[-5].measure)), NU ((yyvsp[-4].measure)), (yyvsp[-3].number), (yyvsp[-2].number), NU ((yyvsp[-1].measure))); } -#line 2617 "parse_y.tab.c" /* yacc.c:1646 */ +#line 2618 "parse_y.tab.c" /* yacc.c:1646 */ break; case 150: -#line 1515 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ +#line 1516 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ { CreateNewArcInElement(yyElement, OU ((yyvsp[-7].measure)) + yyElement->MarkX, OU ((yyvsp[-6].measure)) + yyElement->MarkY, OU ((yyvsp[-5].measure)), OU ((yyvsp[-4].measure)), (yyvsp[-3].number), (yyvsp[-2].number), OU ((yyvsp[-1].measure))); } -#line 2626 "parse_y.tab.c" /* yacc.c:1646 */ +#line 2627 "parse_y.tab.c" /* yacc.c:1646 */ break; case 151: -#line 1519 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ +#line 1520 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ { attr_list = & yyElement->Attributes; } -#line 2632 "parse_y.tab.c" /* yacc.c:1646 */ +#line 2633 "parse_y.tab.c" /* yacc.c:1646 */ break; case 153: -#line 1561 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ +#line 1562 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ { CreateNewPin(yyElement, NU ((yyvsp[-9].measure)) + yyElement->MarkX, NU ((yyvsp[-8].measure)) + yyElement->MarkY, NU ((yyvsp[-7].measure)), NU ((yyvsp[-6].measure)), NU ((yyvsp[-5].measure)), NU ((yyvsp[-4].measure)), (yyvsp[-3].string), @@ -2640,11 +2641,11 @@ free ((yyvsp[-3].string)); free ((yyvsp[-2].string)); } -#line 2644 "parse_y.tab.c" /* yacc.c:1646 */ +#line 2645 "parse_y.tab.c" /* yacc.c:1646 */ break; case 154: -#line 1573 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ +#line 1574 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ { CreateNewPin(yyElement, OU ((yyvsp[-9].measure)) + yyElement->MarkX, OU ((yyvsp[-8].measure)) + yyElement->MarkY, OU ((yyvsp[-7].measure)), OU ((yyvsp[-6].measure)), OU ((yyvsp[-5].measure)), OU ((yyvsp[-4].measure)), (yyvsp[-3].string), @@ -2652,11 +2653,11 @@ free ((yyvsp[-3].string)); free ((yyvsp[-2].string)); } -#line 2656 "parse_y.tab.c" /* yacc.c:1646 */ +#line 2657 "parse_y.tab.c" /* yacc.c:1646 */ break; case 155: -#line 1585 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ +#line 1586 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ { CreateNewPin(yyElement, OU ((yyvsp[-7].measure)), OU ((yyvsp[-6].measure)), OU ((yyvsp[-5].measure)), 2*GROUNDPLANEFRAME, OU ((yyvsp[-5].measure)) + 2*MASKFRAME, OU ((yyvsp[-4].measure)), (yyvsp[-3].string), (yyvsp[-2].string), OldFlags((yyvsp[-1].integer))); @@ -2663,11 +2664,11 @@ free ((yyvsp[-3].string)); free ((yyvsp[-2].string)); } -#line 2667 "parse_y.tab.c" /* yacc.c:1646 */ +#line 2668 "parse_y.tab.c" /* yacc.c:1646 */ break; case 156: -#line 1596 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ +#line 1597 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ { char p_number[8]; @@ -2677,11 +2678,11 @@ free ((yyvsp[-2].string)); } -#line 2681 "parse_y.tab.c" /* yacc.c:1646 */ +#line 2682 "parse_y.tab.c" /* yacc.c:1646 */ break; case 157: -#line 1612 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ +#line 1613 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ { Coord hole = OU ((yyvsp[-3].measure)) * DEFAULT_DRILLINGHOLE; char p_number[8]; @@ -2696,11 +2697,11 @@ OU ((yyvsp[-3].measure)) + 2*MASKFRAME, hole, (yyvsp[-2].string), p_number, OldFlags((yyvsp[-1].integer))); free ((yyvsp[-2].string)); } -#line 2700 "parse_y.tab.c" /* yacc.c:1646 */ +#line 2701 "parse_y.tab.c" /* yacc.c:1646 */ break; case 158: -#line 1666 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ +#line 1667 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ { CreateNewPad(yyElement, NU ((yyvsp[-10].measure)) + yyElement->MarkX, NU ((yyvsp[-9].measure)) + yyElement->MarkY, @@ -2710,11 +2711,11 @@ free ((yyvsp[-3].string)); free ((yyvsp[-2].string)); } -#line 2714 "parse_y.tab.c" /* yacc.c:1646 */ +#line 2715 "parse_y.tab.c" /* yacc.c:1646 */ break; case 159: -#line 1680 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ +#line 1681 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ { CreateNewPad(yyElement,OU ((yyvsp[-10].measure)) + yyElement->MarkX, OU ((yyvsp[-9].measure)) + yyElement->MarkY, OU ((yyvsp[-8].measure)) + yyElement->MarkX, @@ -2723,11 +2724,11 @@ free ((yyvsp[-3].string)); free ((yyvsp[-2].string)); } -#line 2727 "parse_y.tab.c" /* yacc.c:1646 */ +#line 2728 "parse_y.tab.c" /* yacc.c:1646 */ break; case 160: -#line 1693 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ +#line 1694 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ { CreateNewPad(yyElement,OU ((yyvsp[-8].measure)),OU ((yyvsp[-7].measure)),OU ((yyvsp[-6].measure)),OU ((yyvsp[-5].measure)),OU ((yyvsp[-4].measure)), 2*GROUNDPLANEFRAME, OU ((yyvsp[-4].measure)) + 2*MASKFRAME, (yyvsp[-3].string), (yyvsp[-2].string), OldFlags((yyvsp[-1].integer))); @@ -2734,11 +2735,11 @@ free ((yyvsp[-3].string)); free ((yyvsp[-2].string)); } -#line 2738 "parse_y.tab.c" /* yacc.c:1646 */ +#line 2739 "parse_y.tab.c" /* yacc.c:1646 */ break; case 161: -#line 1704 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ +#line 1705 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ { char p_number[8]; @@ -2747,23 +2748,23 @@ OU ((yyvsp[-3].measure)) + 2*MASKFRAME, (yyvsp[-2].string),p_number, OldFlags((yyvsp[-1].integer))); free ((yyvsp[-2].string)); } -#line 2751 "parse_y.tab.c" /* yacc.c:1646 */ +#line 2752 "parse_y.tab.c" /* yacc.c:1646 */ break; case 162: -#line 1714 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ +#line 1715 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ { (yyval.flagtype) = OldFlags((yyvsp[0].integer)); } -#line 2757 "parse_y.tab.c" /* yacc.c:1646 */ +#line 2758 "parse_y.tab.c" /* yacc.c:1646 */ break; case 163: -#line 1715 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ +#line 1716 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ { (yyval.flagtype) = string_to_flags ((yyvsp[0].string), yyerror); free((yyvsp[0].string)); } -#line 2763 "parse_y.tab.c" /* yacc.c:1646 */ +#line 2764 "parse_y.tab.c" /* yacc.c:1646 */ break; case 167: -#line 1745 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ +#line 1746 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ { if ((yyvsp[-3].integer) <= 0 || (yyvsp[-3].integer) > MAX_FONTPOSITION) { @@ -2779,11 +2780,11 @@ Symbol->Valid = true; Symbol->Delta = NU ((yyvsp[-2].measure)); } -#line 2783 "parse_y.tab.c" /* yacc.c:1646 */ +#line 2784 "parse_y.tab.c" /* yacc.c:1646 */ break; case 168: -#line 1761 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ +#line 1762 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ { if ((yyvsp[-3].integer) <= 0 || (yyvsp[-3].integer) > MAX_FONTPOSITION) { @@ -2799,158 +2800,158 @@ Symbol->Valid = true; Symbol->Delta = OU ((yyvsp[-2].measure)); } -#line 2803 "parse_y.tab.c" /* yacc.c:1646 */ +#line 2804 "parse_y.tab.c" /* yacc.c:1646 */ break; case 174: -#line 1808 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ +#line 1809 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ { CreateNewLineInSymbol(Symbol, OU ((yyvsp[-5].measure)), OU ((yyvsp[-4].measure)), OU ((yyvsp[-3].measure)), OU ((yyvsp[-2].measure)), OU ((yyvsp[-1].measure))); } -#line 2811 "parse_y.tab.c" /* yacc.c:1646 */ +#line 2812 "parse_y.tab.c" /* yacc.c:1646 */ break; case 175: -#line 1815 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ +#line 1816 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ { CreateNewLineInSymbol(Symbol, NU ((yyvsp[-5].measure)), NU ((yyvsp[-4].measure)), NU ((yyvsp[-3].measure)), NU ((yyvsp[-2].measure)), NU ((yyvsp[-1].measure))); } -#line 2819 "parse_y.tab.c" /* yacc.c:1646 */ +#line 2820 "parse_y.tab.c" /* yacc.c:1646 */ break; case 183: -#line 1870 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ +#line 1871 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ { Menu = CreateNewNet((LibraryTypePtr)&yyPCB->NetlistLib, (yyvsp[-3].string), (yyvsp[-2].string)); free ((yyvsp[-3].string)); free ((yyvsp[-2].string)); } -#line 2829 "parse_y.tab.c" /* yacc.c:1646 */ +#line 2830 "parse_y.tab.c" /* yacc.c:1646 */ break; case 189: -#line 1905 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ +#line 1906 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ { CreateNewConnection(Menu, (yyvsp[-1].string)); free ((yyvsp[-1].string)); } -#line 2838 "parse_y.tab.c" /* yacc.c:1646 */ +#line 2839 "parse_y.tab.c" /* yacc.c:1646 */ break; case 197: -#line 1952 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ +#line 1953 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ { rats_patch_append(yyPCB, RATP_ADD_CONN, (yyvsp[-2].string), (yyvsp[-1].string), NULL); free((yyvsp[-2].string)); free((yyvsp[-1].string)); } -#line 2844 "parse_y.tab.c" /* yacc.c:1646 */ +#line 2845 "parse_y.tab.c" /* yacc.c:1646 */ break; case 198: -#line 1953 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ +#line 1954 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ { rats_patch_append(yyPCB, RATP_DEL_CONN, (yyvsp[-2].string), (yyvsp[-1].string), NULL); free((yyvsp[-2].string)); free((yyvsp[-1].string)); } -#line 2850 "parse_y.tab.c" /* yacc.c:1646 */ +#line 2851 "parse_y.tab.c" /* yacc.c:1646 */ break; case 199: -#line 1954 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ +#line 1955 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ { rats_patch_append(yyPCB, RATP_CHANGE_ATTRIB, (yyvsp[-3].string), (yyvsp[-2].string), (yyvsp[-1].string)); free((yyvsp[-3].string)); free((yyvsp[-2].string)); free((yyvsp[-1].string)); } -#line 2856 "parse_y.tab.c" /* yacc.c:1646 */ +#line 2857 "parse_y.tab.c" /* yacc.c:1646 */ break; case 200: -#line 1982 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ +#line 1983 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ { CreateNewAttribute (attr_list, (yyvsp[-2].string), (yyvsp[-1].string) ? (yyvsp[-1].string) : (char *)""); free ((yyvsp[-2].string)); free ((yyvsp[-1].string)); } -#line 2866 "parse_y.tab.c" /* yacc.c:1646 */ +#line 2867 "parse_y.tab.c" /* yacc.c:1646 */ break; case 201: -#line 1989 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ +#line 1990 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ { (yyval.string) = (yyvsp[0].string); } -#line 2872 "parse_y.tab.c" /* yacc.c:1646 */ +#line 2873 "parse_y.tab.c" /* yacc.c:1646 */ break; case 202: -#line 1990 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ +#line 1991 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ { (yyval.string) = 0; } -#line 2878 "parse_y.tab.c" /* yacc.c:1646 */ +#line 2879 "parse_y.tab.c" /* yacc.c:1646 */ break; case 203: -#line 1994 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ +#line 1995 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ { (yyval.number) = (yyvsp[0].number); } -#line 2884 "parse_y.tab.c" /* yacc.c:1646 */ +#line 2885 "parse_y.tab.c" /* yacc.c:1646 */ break; case 204: -#line 1995 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ +#line 1996 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ { (yyval.number) = (yyvsp[0].integer); } -#line 2890 "parse_y.tab.c" /* yacc.c:1646 */ +#line 2891 "parse_y.tab.c" /* yacc.c:1646 */ break; case 205: -#line 2000 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ +#line 2001 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ { do_measure(&(yyval.measure), (yyvsp[0].number), MIL_TO_COORD ((yyvsp[0].number)) / 100.0, 0); } -#line 2896 "parse_y.tab.c" /* yacc.c:1646 */ +#line 2897 "parse_y.tab.c" /* yacc.c:1646 */ break; case 206: -#line 2001 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ +#line 2002 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ { M ((yyval.measure), (yyvsp[-1].number), MIL_TO_COORD ((yyvsp[-1].number)) / 100000.0); } -#line 2902 "parse_y.tab.c" /* yacc.c:1646 */ +#line 2903 "parse_y.tab.c" /* yacc.c:1646 */ break; case 207: -#line 2002 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ +#line 2003 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ { M ((yyval.measure), (yyvsp[-1].number), MIL_TO_COORD ((yyvsp[-1].number)) / 100.0); } -#line 2908 "parse_y.tab.c" /* yacc.c:1646 */ +#line 2909 "parse_y.tab.c" /* yacc.c:1646 */ break; case 208: -#line 2003 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ +#line 2004 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ { M ((yyval.measure), (yyvsp[-1].number), MIL_TO_COORD ((yyvsp[-1].number))); } -#line 2914 "parse_y.tab.c" /* yacc.c:1646 */ +#line 2915 "parse_y.tab.c" /* yacc.c:1646 */ break; case 209: -#line 2004 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ +#line 2005 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ { M ((yyval.measure), (yyvsp[-1].number), INCH_TO_COORD ((yyvsp[-1].number))); } -#line 2920 "parse_y.tab.c" /* yacc.c:1646 */ +#line 2921 "parse_y.tab.c" /* yacc.c:1646 */ break; case 210: -#line 2005 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ +#line 2006 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ { M ((yyval.measure), (yyvsp[-1].number), MM_TO_COORD ((yyvsp[-1].number)) / 1000000.0); } -#line 2926 "parse_y.tab.c" /* yacc.c:1646 */ +#line 2927 "parse_y.tab.c" /* yacc.c:1646 */ break; case 211: -#line 2006 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ +#line 2007 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ { M ((yyval.measure), (yyvsp[-1].number), MM_TO_COORD ((yyvsp[-1].number)) / 1000.0); } -#line 2932 "parse_y.tab.c" /* yacc.c:1646 */ +#line 2933 "parse_y.tab.c" /* yacc.c:1646 */ break; case 212: -#line 2007 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ +#line 2008 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ { M ((yyval.measure), (yyvsp[-1].number), MM_TO_COORD ((yyvsp[-1].number))); } -#line 2938 "parse_y.tab.c" /* yacc.c:1646 */ +#line 2939 "parse_y.tab.c" /* yacc.c:1646 */ break; case 213: -#line 2008 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ +#line 2009 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ { M ((yyval.measure), (yyvsp[-1].number), MM_TO_COORD ((yyvsp[-1].number)) * 1000.0); } -#line 2944 "parse_y.tab.c" /* yacc.c:1646 */ +#line 2945 "parse_y.tab.c" /* yacc.c:1646 */ break; case 214: -#line 2009 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ +#line 2010 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ { M ((yyval.measure), (yyvsp[-1].number), MM_TO_COORD ((yyvsp[-1].number)) * 1000000.0); } -#line 2950 "parse_y.tab.c" /* yacc.c:1646 */ +#line 2951 "parse_y.tab.c" /* yacc.c:1646 */ break; -#line 2954 "parse_y.tab.c" /* yacc.c:1646 */ +#line 2955 "parse_y.tab.c" /* yacc.c:1646 */ default: break; } /* User semantic actions sometimes alter yychar, and that requires @@ -3178,7 +3179,7 @@ #endif return yyresult; } -#line 2012 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1906 */ +#line 2013 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1906 */ /* --------------------------------------------------------------------------- Index: trunk/src_plugins/io_pcb/parse_y.h =================================================================== --- trunk/src_plugins/io_pcb/parse_y.h (revision 2032) +++ trunk/src_plugins/io_pcb/parse_y.h (revision 2033) @@ -101,7 +101,7 @@ typedef union YYSTYPE YYSTYPE; union YYSTYPE { -#line 114 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1909 */ +#line 115 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1909 */ int integer; double number; Index: trunk/src_plugins/io_pcb/parse_y.y =================================================================== --- trunk/src_plugins/io_pcb/parse_y.y (revision 2032) +++ trunk/src_plugins/io_pcb/parse_y.y (revision 2033) @@ -56,6 +56,7 @@ #include "thermal.h" #include "rats_patch.h" #include "flags.h" +#include "route_style.h" #ifdef HAVE_LIBDMALLOC # include /* see http://dmalloc.com */ @@ -665,7 +666,7 @@ pcbstyles : T_STYLES '(' STRING ')' { - if (ParseRouteString($3, &yyPCB->RouteStyle[0], "mil")) + if (ParseRouteString($3, &yyPCB->RouteStyle, "mil")) { Message("illegal route-style string\n"); YYABORT; @@ -674,7 +675,7 @@ } | T_STYLES '[' STRING ']' { - if (ParseRouteString($3, &yyPCB->RouteStyle[0], "cmil")) + if (ParseRouteString($3, &yyPCB->RouteStyle, "cmil")) { Message("illegal route-style string\n"); YYABORT;