Index: trunk/src/action_helper.c =================================================================== --- trunk/src/action_helper.c (revision 1807) +++ trunk/src/action_helper.c (revision 1808) @@ -410,7 +410,7 @@ int type = NO_TYPE; void *ptr1, *ptr2, *ptr3; - if (!Marked.status || TEST_FLAG(LOCALREFFLAG, PCB)) + if (!Marked.status || conf_core.editor.local_ref) SetLocalRef(Crosshair.X, Crosshair.Y, true); switch (Crosshair.AttachedLine.State) { case STATE_FIRST: /* first point */ @@ -418,7 +418,7 @@ gui->beep(); break; } - if (TEST_FLAG(AUTODRCFLAG, PCB) && conf_core.editor.mode == LINE_MODE) { + if (conf_core.editor.auto_drc && conf_core.editor.mode == LINE_MODE) { type = SearchScreen(Crosshair.X, Crosshair.Y, PIN_TYPE | PAD_TYPE | VIA_TYPE, &ptr1, &ptr2, &ptr3); LookupConnection(Crosshair.X, Crosshair.Y, true, 1, FOUNDFLAG); } @@ -587,7 +587,7 @@ dir, conf_core.design.line_thickness, 2 * conf_core.design.keepaway, - MakeFlags(TEST_FLAG(CLEARNEWFLAG, PCB) ? CLEARLINEFLAG : 0)))) { + MakeFlags(conf_core.editor.clear_line ? CLEARLINEFLAG : 0)))) { BoxTypePtr bx; bx = GetArcEnds(arc); @@ -714,7 +714,7 @@ Crosshair.AttachedLine.Point2.Y = Note.Y; } - if (TEST_FLAG(AUTODRCFLAG, PCB) + if (conf_core.editor.auto_drc && !TEST_SILK_LAYER(CURRENT)) maybe_found_flag = FOUNDFLAG; else @@ -731,7 +731,7 @@ conf_core.design.line_thickness, 2 * conf_core.design.keepaway, MakeFlags(maybe_found_flag | - (TEST_FLAG(CLEARNEWFLAG, PCB) ? CLEARLINEFLAG : 0)))) != NULL) { + (conf_core.editor.clear_line ? CLEARLINEFLAG : 0)))) != NULL) { PinTypePtr via; addedLines++; @@ -770,10 +770,8 @@ Note.X, Note.Y, conf_core.design.line_thickness, 2 * conf_core.design.keepaway, - MakeFlags((TEST_FLAG - (AUTODRCFLAG, - PCB) ? FOUNDFLAG : 0) | - (TEST_FLAG(CLEARNEWFLAG, PCB) ? CLEARLINEFLAG : 0)))) != NULL) { + MakeFlags((conf_core.editor.auto_drc ? FOUNDFLAG : 0) | + (conf_core.editor.clear_line ? CLEARLINEFLAG : 0)))) != NULL) { addedLines++; AddObjectToCreateUndoList(LINE_TYPE, CURRENT, line, line); IncrementUndoSerialNumber(); @@ -783,7 +781,7 @@ Crosshair.AttachedLine.Point1.Y = Note.Y; Crosshair.AttachedLine.Point2.X = Note.X; Crosshair.AttachedLine.Point2.Y = Note.Y; - if (TEST_FLAG(SWAPSTARTDIRFLAG, PCB)) { + if (conf_core.editor.swap_start_direction) { PCB->Clipping ^= 3; } } @@ -804,7 +802,7 @@ PolygonTypePtr polygon; int flags = CLEARPOLYFLAG; - if (TEST_FLAG(NEWFULLPOLYFLAG, PCB)) + if (conf_core.editor.full_poly) flags |= FULLPOLYFLAG; if ((polygon = CreateNewPolygonFromRectangle(CURRENT, Crosshair.AttachedBox.Point1.X, @@ -983,7 +981,7 @@ int i, save_n; e = (ElementTypePtr) ptr1; - save_n = NAME_INDEX(PCB); + save_n = NAME_INDEX(); for (i = 0; i < MAX_ELEMENTNAMES; i++) { if (i == save_n) Index: trunk/src/change.c =================================================================== --- trunk/src/change.c (revision 1807) +++ trunk/src/change.c (revision 1808) @@ -1149,7 +1149,7 @@ printf("In ChangeElementText, updating old TextString %s to %s\n", old, new_name); #endif - if (pcb && which == NAME_INDEX(pcb)) + if (pcb && which == NAME_INDEX()) EraseElementName(Element); r_delete_entry(data->name_tree[which], &Element->Name[which].BoundingBox); @@ -1159,7 +1159,7 @@ r_insert_entry(data->name_tree[which], &Element->Name[which].BoundingBox, 0); - if (pcb && which == NAME_INDEX(pcb)) + if (pcb && which == NAME_INDEX()) DrawElementName(Element); return old; @@ -1169,14 +1169,14 @@ { if (TEST_FLAG(LOCKFLAG, &Element->Name[0])) return (NULL); - if (NAME_INDEX(PCB) == NAMEONPCB_INDEX) { - if (TEST_FLAG(UNIQUENAMEFLAG, PCB) && UniqueElementName(PCB->Data, NewName) != NewName) { + if (NAME_INDEX() == NAMEONPCB_INDEX) { + if (conf_core.editor.unique_names && UniqueElementName(PCB->Data, NewName) != NewName) { Message(_("Error: The name \"%s\" is not unique!\n"), NewName); return ((char *) -1); } } - return ChangeElementText(PCB, PCB->Data, Element, NAME_INDEX(PCB), NewName); + return ChangeElementText(PCB, PCB->Data, Element, NAME_INDEX(), NewName); } static void *ChangeElementNonetlist(ElementTypePtr Element) @@ -1823,7 +1823,7 @@ /* setup identifiers */ Absolute = (fixIt) ? Difference : 0; Delta = Difference; - if (TEST_FLAG(SHOWMASKFLAG, PCB)) + if (conf_core.editor.show_mask) change = SelectedOperation(&ChangeMaskSizeFunctions, false, types); else change = SelectedOperation(&ChangeClearSizeFunctions, false, types); @@ -2140,7 +2140,7 @@ /* setup identifier */ Absolute = (fixIt) ? Difference : 0; Delta = Difference; - if (TEST_FLAG(SHOWMASKFLAG, PCB)) + if (conf_core.editor.show_mask) change = (ObjectOperation(&ChangeMaskSizeFunctions, Type, Ptr1, Ptr2, Ptr3) != NULL); else change = (ObjectOperation(&ChangeClearSizeFunctions, Type, Ptr1, Ptr2, Ptr3) != NULL); Index: trunk/src/conf_core.h =================================================================== --- trunk/src/conf_core.h (revision 1807) +++ trunk/src/conf_core.h (revision 1808) @@ -42,14 +42,16 @@ CFT_BOOLEAN auto_place; /* flag which says we should force placement of the windows on startup */ CFT_BOOLEAN lock_names; /* lock down text so they can not be moved or selected */ CFT_BOOLEAN only_names; /* lock down everything else but text so only text objects can be moved or selected */ - CFT_BOOLEAN hide_names; /* when set, element names are not drawn. */ CFT_BOOLEAN thin_draw; /* if set, objects on the screen are drawn as outlines (lines are drawn as center-lines). This lets you see line endpoints hidden under pins, for example. */ CFT_BOOLEAN thin_draw_poly; /* if set, polygons on the screen are drawn as outlines. */ CFT_BOOLEAN local_ref; /* use local reference for moves, by setting the mark at the beginning of each move. */ CFT_BOOLEAN check_planes; /* when set, only polygons and their clearances are drawn, to see if polygons have isolated regions. */ + CFT_BOOLEAN show_mask; /* show the solder mask layer */ + +#warning TODO: should be an enum maybe? + CFT_BOOLEAN hide_names; /* when set, element names are not drawn. */ CFT_BOOLEAN description; /* display element description as element name, instead of value */ CFT_BOOLEAN name_on_pcb; /* display Reference Designator as element name, instead of value */ - CFT_BOOLEAN show_mask; /* show the solder mask layer */ #warning TODO: move all the rest in plugins (watch out for io_pcb string path refs): CFT_BOOLEAN enable_stroke; /* Enable libstroke gesutres on middle mouse button when non-zero */ Index: trunk/src/const.h =================================================================== --- trunk/src/const.h (revision 1807) +++ trunk/src/const.h (revision 1808) @@ -222,97 +222,6 @@ #define NOCOPY_FLAGS (FOUNDFLAG | CONNECTEDFLAG | ONPOINTFLAG) /* --------------------------------------------------------------------------- - * PCB flags - */ - -/* %start-doc pcbfile ~pcbflags -@node PCBFlags -@section PCBFlags -@table @code -@item 0x00001 -Pinout displays pin numbers instead of pin names. -@item 0x00002 -Use local reference for moves, by setting the mark at the beginning of -each move. -@item 0x00004 -When set, only polygons and their clearances are drawn, to see if -polygons have isolated regions. -@item 0x00008 -Display DRC region on crosshair. -@item 0x00010 -Do all move, mirror, rotate with rubberband connections. -@item 0x00020 -Display descriptions of elements, instead of refdes. -@item 0x00040 -Display names of elements, instead of refdes. -@item 0x00080 -Auto-DRC flag. When set, PCB doesn't let you place copper that -violates DRC. -@item 0x00100 -Enable 'all-direction' lines. -@item 0x00200 -Switch starting angle after each click. -@item 0x00400 -Force unique names on board. -@item 0x00800 -New lines/arc clear polygons. -@item 0x01000 -Crosshair snaps to pins and pads. -@item 0x02000 -Show the solder mask layer. -@item 0x04000 -Draw with thin lines. -@item 0x08000 -Move items orthogonally. -@item 0x10000 -Draw autoroute paths real-time. -@item 0x20000 -New polygons are full ones. -@item 0x40000 -Names are locked, the mouse cannot select them. -@item 0x80000 -Everything but names are locked, the mouse cannot select anything else. -@item 0x100000 -New polygons are full polygons. -@item 0x200000 -When set, element names are not drawn. -+@item 0x800000 -+snap to certain off-grid points. -+@item 0x1000000 -+highlight lines and arcs when the crosshair is on one of their endpoints. -@end table -%end-doc */ - -#define PCB_FLAGS 0x01ffffff /* all used flags */ - -#define SHOWNUMBERFLAG 0x00000001 -#define LOCALREFFLAG 0x00000002 -#define CHECKPLANESFLAG 0x00000004 -#define SHOWDRCFLAG 0x00000008 -#define RUBBERBANDFLAG 0x00000010 -#define DESCRIPTIONFLAG 0x00000020 -#define NAMEONPCBFLAG 0x00000040 -#define AUTODRCFLAG 0x00000080 -#define ALLDIRECTIONFLAG 0x00000100 -#define SWAPSTARTDIRFLAG 0x00000200 -#define UNIQUENAMEFLAG 0x00000400 -#define CLEARNEWFLAG 0x00000800 -#define SNAPPINFLAG 0x00001000 -#define SHOWMASKFLAG 0x00002000 -#define THINDRAWFLAG 0x00004000 -#define ORTHOMOVEFLAG 0x00008000 -#define LIVEROUTEFLAG 0x00010000 -#define THINDRAWPOLYFLAG 0x00020000 -#define LOCKNAMESFLAG 0x00040000 -#define ONLYNAMESFLAG 0x00080000 -#define NEWFULLPOLYFLAG 0x00100000 -#define HIDENAMESFLAG 0x00200000 -#define ENABLEMINCUTFLAG 0x00400000 -#define SNAPOFFGRIDLINEFLAG 0x00800000 -#define HIGHLIGHTONPOINTFLAG 0x01000000 -#define ENABLESTROKEFLAG 0x02000000 - -/* --------------------------------------------------------------------------- * object types */ #define NO_TYPE 0x00000 /* no object */ Index: trunk/src/copy.c =================================================================== --- trunk/src/copy.c (revision 1807) +++ trunk/src/copy.c (revision 1808) @@ -263,8 +263,7 @@ ElementTypePtr element = CopyElementLowLevel(PCB->Data, NULL, Element, - TEST_FLAG(UNIQUENAMEFLAG, - PCB), DeltaX, + conf_core.editor.unique_names, DeltaX, DeltaY); /* this call clears the polygons */ Index: trunk/src/create.c =================================================================== --- trunk/src/create.c (revision 1807) +++ trunk/src/create.c (revision 1808) @@ -143,36 +143,10 @@ ptr->IsleArea = 2.e8; ptr->SilkActive = false; ptr->RatDraw = false; - SET_FLAG(NAMEONPCBFLAG, ptr); - if (conf_core.editor.show_number) - SET_FLAG(SHOWNUMBERFLAG, ptr); - if (conf_core.editor.all_direction_lines) - SET_FLAG(ALLDIRECTIONFLAG, ptr); + + /* NOTE: we used to set all the pcb flags on ptr here, but we don't need to do that anymore due to the new conf system */ ptr->Clipping = 1; /* this is the most useful starting point for now */ - if (conf_core.editor.rubber_band_mode) - SET_FLAG(RUBBERBANDFLAG, ptr); - if (conf_core.editor.swap_start_direction) - SET_FLAG(SWAPSTARTDIRFLAG, ptr); - if (conf_core.editor.unique_names) - SET_FLAG(UNIQUENAMEFLAG, ptr); - if (conf_core.editor.snap_pin) - SET_FLAG(SNAPPINFLAG, ptr); - if (conf_core.editor.snap_offgrid_line) - SET_FLAG(SNAPOFFGRIDLINEFLAG, ptr); - if (conf_core.editor.highlight_on_point) - SET_FLAG(HIGHLIGHTONPOINTFLAG, ptr); - if (conf_core.editor.clear_line) - SET_FLAG(CLEARNEWFLAG, ptr); - if (conf_core.editor.full_poly) - SET_FLAG(NEWFULLPOLYFLAG, ptr); - if (conf_core.editor.orthogonal_moves) - SET_FLAG(ORTHOMOVEFLAG, ptr); - if (conf_core.editor.live_routing) - SET_FLAG(LIVEROUTEFLAG, ptr); - if (conf_core.editor.show_drc) - SET_FLAG(SHOWDRCFLAG, ptr); - if (conf_core.editor.auto_drc) - SET_FLAG(AUTODRCFLAG, ptr); + ptr->Grid = conf_core.editor.grid; ParseGroupString(conf_core.design.groups, &ptr->LayerGroups, MAX_LAYER); STYLE_LOOP(ptr); Index: trunk/src/crosshair.c =================================================================== --- trunk/src/crosshair.c (revision 1807) +++ trunk/src/crosshair.c (revision 1808) @@ -470,7 +470,7 @@ gui->thindraw_pcb_pv(Crosshair.GC, Crosshair.GC, &via, true, false); - if (TEST_FLAG(SHOWDRCFLAG, PCB)) { + if (conf_core.editor.show_drc) { /* XXX: Naughty cheat - use the mask to draw DRC clearance! */ via.Mask = conf_core.design.via_thickness + PCB->Bloat * 2; gui->set_color(Crosshair.GC, conf_core.appearance.color.cross); @@ -498,7 +498,7 @@ case ARC_MODE: if (Crosshair.AttachedBox.State != STATE_FIRST) { XORDrawAttachedArc(conf_core.design.line_thickness); - if (TEST_FLAG(SHOWDRCFLAG, PCB)) { + if (conf_core.editor.show_drc) { gui->set_color(Crosshair.GC, conf_core.appearance.color.cross); XORDrawAttachedArc(conf_core.design.line_thickness + 2 * (PCB->Bloat + 1)); gui->set_color(Crosshair.GC, conf_core.appearance.color.crosshair); @@ -519,7 +519,7 @@ XORDrawAttachedLine(Crosshair.AttachedLine.Point2.X, Crosshair.AttachedLine.Point2.Y, Crosshair.X, Crosshair.Y, PCB->RatDraw ? 10 : conf_core.design.line_thickness); - if (TEST_FLAG(SHOWDRCFLAG, PCB)) { + if (conf_core.editor.show_drc) { gui->set_color(Crosshair.GC, conf_core.appearance.color.cross); XORDrawAttachedLine(Crosshair.AttachedLine.Point1.X, Crosshair.AttachedLine.Point1.Y, @@ -879,7 +879,7 @@ double dx, dy; double dist; - if (!TEST_FLAG(SNAPPINFLAG, PCB)) + if (!conf_core.editor.snap_pin) return; /* Code to snap at some sensible point along a line */ @@ -971,7 +971,7 @@ nearest_grid_x = GridFit(Crosshair.X, PCB->Grid, PCB->GridOffsetX); nearest_grid_y = GridFit(Crosshair.Y, PCB->Grid, PCB->GridOffsetY); - if (Marked.status && TEST_FLAG(ORTHOMOVEFLAG, PCB)) { + if (Marked.status && conf_core.editor.orthogonal_moves) { Coord dx = Crosshair.X - Marked.X; Coord dy = Crosshair.Y - Marked.Y; if (PCB_ABS(dx) > PCB_ABS(dy)) @@ -998,7 +998,7 @@ } ans = NO_TYPE; - if (PCB->RatDraw || TEST_FLAG(SNAPPINFLAG, PCB)) + if (PCB->RatDraw || conf_core.editor.snap_pin) ans = SearchScreenGridSlop(Crosshair.X, Crosshair.Y, PAD_TYPE, &ptr1, &ptr2, &ptr3); /* Avoid self-snapping when moving */ @@ -1043,7 +1043,7 @@ } ans = NO_TYPE; - if (PCB->RatDraw || TEST_FLAG(SNAPPINFLAG, PCB)) + if (PCB->RatDraw || conf_core.editor.snap_pin) ans = SearchScreenGridSlop(Crosshair.X, Crosshair.Y, PIN_TYPE, &ptr1, &ptr2, &ptr3); /* Avoid self-snapping when moving */ @@ -1057,7 +1057,7 @@ } ans = NO_TYPE; - if (TEST_FLAG(SNAPPINFLAG, PCB)) + if (conf_core.editor.snap_pin) ans = SearchScreenGridSlop(Crosshair.X, Crosshair.Y, VIA_TYPE, &ptr1, &ptr2, &ptr3); /* Avoid snapping vias to any other vias */ @@ -1070,7 +1070,7 @@ } ans = NO_TYPE; - if (TEST_FLAG(SNAPPINFLAG, PCB)) + if (conf_core.editor.snap_pin) ans = SearchScreenGridSlop(Crosshair.X, Crosshair.Y, LINEPOINT_TYPE, &ptr1, &ptr2, &ptr3); if (ans != NO_TYPE) { @@ -1081,11 +1081,11 @@ /* * Snap to offgrid points on lines. */ - if (TEST_FLAG(SNAPOFFGRIDLINEFLAG, PCB)) + if (conf_core.editor.snap_offgrid_line) check_snap_offgrid_line(&snap_data, nearest_grid_x, nearest_grid_y); ans = NO_TYPE; - if (TEST_FLAG(SNAPPINFLAG, PCB)) + if (conf_core.editor.snap_pin) ans = SearchScreenGridSlop(Crosshair.X, Crosshair.Y, POLYGONPOINT_TYPE, &ptr1, &ptr2, &ptr3); if (ans != NO_TYPE) { @@ -1098,7 +1098,7 @@ Crosshair.Y = snap_data.y; } - if (TEST_FLAG(HIGHLIGHTONPOINTFLAG, PCB)) + if (conf_core.editor.highlight_on_point) onpoint_work(&Crosshair, Crosshair.X, Crosshair.Y); if (conf_core.editor.mode == ARROW_MODE) { @@ -1109,7 +1109,7 @@ hid_actionl("PointCursor", "True", NULL); } - if (conf_core.editor.mode == LINE_MODE && Crosshair.AttachedLine.State != STATE_FIRST && TEST_FLAG(AUTODRCFLAG, PCB)) + if (conf_core.editor.mode == LINE_MODE && Crosshair.AttachedLine.State != STATE_FIRST && conf_core.editor.auto_drc) EnforceLineDRC(); gui->set_crosshair(Crosshair.X, Crosshair.Y, HID_SC_DO_NOTHING); Index: trunk/src/draw.c =================================================================== --- trunk/src/draw.c (revision 1807) +++ trunk/src/draw.c (revision 1808) @@ -199,7 +199,7 @@ if (!pv->Name || !pv->Name[0]) pn = EMPTY(pv->Number); else - pn = EMPTY(TEST_FLAG(SHOWNUMBERFLAG, PCB) ? pv->Number : pv->Name); + pn = EMPTY(conf_core.editor.show_number ? pv->Number : pv->Name); if (GET_INTCONN(pv) > 0) snprintf(buff, sizeof(buff), "%s[%d]", pn, GET_INTCONN(pv)); @@ -236,7 +236,7 @@ static void _draw_pv(PinTypePtr pv, bool draw_hole) { - if (TEST_FLAG(THINDRAWFLAG, PCB)) + if (conf_core.editor.thin_draw) gui->thindraw_pcb_pv(Output.fgGC, Output.fgGC, pv, draw_hole, false); else gui->fill_pcb_pv(Output.fgGC, Output.bgGC, pv, draw_hole, false); @@ -281,7 +281,7 @@ if (!pad->Name || !pad->Name[0]) pn = EMPTY(pad->Number); else - pn = EMPTY(TEST_FLAG(SHOWNUMBERFLAG, PCB) ? pad->Number : pad->Name); + pn = conf_core.editor.show_number ? pad->Number : pad->Name; if (GET_INTCONN(pad) > 0) snprintf(buff, sizeof(buff), "%s[%d]", pn, GET_INTCONN(pad)); @@ -322,7 +322,7 @@ if (clear && !mask && pad->Clearance <= 0) return; - if (TEST_FLAG(THINDRAWFLAG, PCB) || (clear && TEST_FLAG(THINDRAWPOLYFLAG, PCB))) + if (conf_core.editor.thin_draw || (clear && conf_core.editor.thin_draw_poly)) gui->thindraw_pcb_pad(gc, pad, clear, mask); else gui->fill_pcb_pad(gc, pad, clear, mask); @@ -375,7 +375,7 @@ static void draw_element_name(ElementType * element) { - if ((TEST_FLAG(HIDENAMESFLAG, PCB) && gui->gui) || TEST_FLAG(HIDENAMEFLAG, element)) + if ((conf_core.editor.hide_names && gui->gui) || TEST_FLAG(HIDENAMEFLAG, element)) return; if (doing_pinout || doing_assy) gui->set_color(Output.fgGC, PCB->ElementColor); @@ -442,7 +442,7 @@ if ((plated == 0 && !TEST_FLAG(HOLEFLAG, pv)) || (plated == 1 && TEST_FLAG(HOLEFLAG, pv))) return 1; - if (TEST_FLAG(THINDRAWFLAG, PCB)) { + if (conf_core.editor.thin_draw) { if (!TEST_FLAG(HOLEFLAG, pv)) { gui->set_line_cap(Output.fgGC, Round_Cap); gui->set_line_width(Output.fgGC, 0); @@ -490,7 +490,7 @@ static void _draw_line(LineType * line) { gui->set_line_cap(Output.fgGC, Trace_Cap); - if (TEST_FLAG(THINDRAWFLAG, PCB)) + if (conf_core.editor.thin_draw) gui->set_line_width(Output.fgGC, 0); else gui->set_line_width(Output.fgGC, line->Thickness); @@ -549,7 +549,7 @@ if (TEST_FLAG(VIAFLAG, rat)) { int w = rat->Thickness; - if (TEST_FLAG(THINDRAWFLAG, PCB)) + if (conf_core.editor.thin_draw) gui->set_line_width(Output.fgGC, 0); else gui->set_line_width(Output.fgGC, w); @@ -565,7 +565,7 @@ if (!arc->Thickness) return; - if (TEST_FLAG(THINDRAWFLAG, PCB)) + if (conf_core.editor.thin_draw) gui->set_line_width(Output.fgGC, 0); else gui->set_line_width(Output.fgGC, arc->Thickness); @@ -691,12 +691,12 @@ /* * first draw all 'invisible' stuff */ - if (!TEST_FLAG(CHECKPLANESFLAG, PCB) + if (!conf_core.editor.check_planes && gui->set_layer("invisible", SL(INVISIBLE, 0), 0)) { side = SWAP_IDENT ? COMPONENT_LAYER : SOLDER_LAYER; if (PCB->ElementOn) { r_search(PCB->Data->element_tree, drawn_area, NULL, element_callback, &side); - r_search(PCB->Data->name_tree[NAME_INDEX(PCB)], drawn_area, NULL, name_callback, &side); + r_search(PCB->Data->name_tree[NAME_INDEX()], drawn_area, NULL, name_callback, &side); DrawLayer(&(PCB->Data->Layer[max_copper_layer + side]), drawn_area); } r_search(PCB->Data->pad_tree, drawn_area, NULL, pad_callback, &side); @@ -713,7 +713,7 @@ } } - if (TEST_FLAG(CHECKPLANESFLAG, PCB) && gui->gui) + if (conf_core.editor.check_planes && gui->gui) return; /* Draw pins, pads, vias below silk */ @@ -869,7 +869,7 @@ static int clearPin_callback(const BoxType * b, void *cl) { PinType *pin = (PinTypePtr) b; - if (TEST_FLAG(THINDRAWFLAG, PCB) || TEST_FLAG(THINDRAWPOLYFLAG, PCB)) + if (conf_core.editor.thin_draw || conf_core.editor.thin_draw_poly) gui->thindraw_pcb_pv(Output.pmGC, Output.pmGC, pin, false, true); else gui->fill_pcb_pv(Output.pmGC, Output.pmGC, pin, false, true); @@ -906,13 +906,13 @@ color = i->layer->Color; gui->set_color(Output.fgGC, color); - if (gui->thindraw_pcb_polygon != NULL && (TEST_FLAG(THINDRAWFLAG, PCB) || TEST_FLAG(THINDRAWPOLYFLAG, PCB))) + if (gui->thindraw_pcb_polygon != NULL && conf_core.editor.thin_draw || conf_core.editor.thin_draw_poly) gui->thindraw_pcb_polygon(Output.fgGC, polygon, i->drawn_area); else gui->fill_pcb_polygon(Output.fgGC, polygon, i->drawn_area); /* If checking planes, thin-draw any pieces which have been clipped away */ - if (gui->thindraw_pcb_polygon != NULL && TEST_FLAG(CHECKPLANESFLAG, PCB) && !TEST_FLAG(FULLPOLYFLAG, polygon)) { + if (gui->thindraw_pcb_polygon != NULL && conf_core.editor.check_planes && !TEST_FLAG(FULLPOLYFLAG, polygon)) { PolygonType poly = *polygon; for (poly.Clipped = polygon->Clipped->f; poly.Clipped != polygon->Clipped; poly.Clipped = poly.Clipped->f) @@ -950,7 +950,7 @@ DrawLayer(LAYER_PTR(max_copper_layer + side), drawn_area); /* draw package */ r_search(PCB->Data->element_tree, drawn_area, NULL, element_callback, &side); - r_search(PCB->Data->name_tree[NAME_INDEX(PCB)], drawn_area, NULL, name_callback, &side); + r_search(PCB->Data->name_tree[NAME_INDEX()], drawn_area, NULL, name_callback, &side); #if 0 } @@ -964,7 +964,7 @@ DrawLayer(LAYER_PTR(max_copper_layer + layer), drawn_area); /* draw package */ r_search(PCB->Data->element_tree, drawn_area, NULL, element_callback, &side); - r_search(PCB->Data->name_tree[NAME_INDEX(PCB)], drawn_area, NULL, name_callback, &side); + r_search(PCB->Data->name_tree[NAME_INDEX()], drawn_area, NULL, name_callback, &side); } gui->use_mask(HID_MASK_OFF); #endif @@ -990,7 +990,7 @@ */ static void DrawMask(int side, const BoxType * screen) { - int thin = TEST_FLAG(THINDRAWFLAG, PCB) || TEST_FLAG(THINDRAWPOLYFLAG, PCB); + int thin = conf_core.editor.thin_draw || conf_core.editor.thin_draw_poly; if (thin) gui->set_color(Output.pmGC, PCB->MaskColor); @@ -1070,7 +1070,7 @@ /* print the non-clearing polys */ r_search(Layer->polygon_tree, screen, NULL, poly_callback, &info); - if (TEST_FLAG(CHECKPLANESFLAG, PCB)) + if (conf_core.editor.check_planes) return; /* draw all visible lines this layer */ Index: trunk/src/flags.c =================================================================== --- trunk/src/flags.c (revision 1807) +++ trunk/src/flags.c (revision 1808) @@ -89,9 +89,9 @@ static int FlagElementName(int dummy) { - if (TEST_FLAG(NAMEONPCBFLAG, PCB)) + if (conf_core.editor.name_on_pcb) return 2; - if (TEST_FLAG(DESCRIPTIONFLAG, PCB)) + if (conf_core.editor.description) return 1; return 3; } @@ -145,7 +145,7 @@ case FL_BACK: return PCB->InvisibleObjectsOn; case FL_MASK: - return TEST_FLAG(SHOWMASKFLAG, PCB); + return conf_core.editor.show_mask; default: if (n >= 0 && n < max_copper_layer) return PCB->Data->Layer[n].On; @@ -172,7 +172,6 @@ * 64bit machines. */ #define OffsetOf(a,b) (int)(size_t)(&(((a *)0)->b)) -#warning TODO: do we still need this? HID_Flag flags_flag_list[] = { {"style", FlagCurrentStyle, 0} , @@ -240,7 +239,12 @@ , {"viamode", FlagMode, VIA_MODE} , - + {"grid_units_mm", FlagUnitsMm, -1} + , + {"grid_units_mil", FlagUnitsMil, -1} + , +#warning TODO: access these via the conf system +#if 0 {"shownumber", FlagTESTFLAG, SHOWNUMBERFLAG} , {"localref", FlagTESTFLAG, LOCALREFFLAG} @@ -285,21 +289,14 @@ , {"hidenames", FlagTESTFLAG, HIDENAMESFLAG} , - {"enablemincut", FlagTESTFLAG, ENABLEMINCUTFLAG} + {"enablestroke", FlagTESTFLAG, OffsetOf(conf_core_t, editor.enable_stroke)} , - {"enablestroke", FlagTESTFLAG, ENABLESTROKEFLAG} + {"snapoffgridline", FlagTESTFLAG, ffsetOf(conf_core_t, editor.snap_offgrid_line)} , - {"snapoffgridline", FlagTESTFLAG, SNAPOFFGRIDLINEFLAG} + {"highlightonpoint", FlagTESTFLAG, OffsetOf(conf_core_t, editor.highlight_on_point)} , - {"highlightonpoint", FlagTESTFLAG, HIGHLIGHTONPOINTFLAG} - , - {"fullpoly", FlagSETTINGS, OffsetOf(conf_core_t, editor.full_poly)} , - {"grid_units_mm", FlagUnitsMm, -1} - , - {"grid_units_mil", FlagUnitsMil, -1} - , {"clearline", FlagSETTINGS, OffsetOf(conf_core_t, editor.clear_line)} , {"uniquenames", FlagSETTINGS, OffsetOf(conf_core_t, editor.unique_names)} @@ -328,7 +325,7 @@ , {"ringbellwhenfinished", FlagSETTINGS, OffsetOf(conf_core_t, editor.beep_when_finished)} , - +#endif {"buffer", FlagBuffer, 0} , Index: trunk/src/global.h =================================================================== --- trunk/src/global.h (revision 1807) +++ trunk/src/global.h (revision 1808) @@ -301,6 +301,7 @@ */ typedef struct PCBType { long ID; /* see macro.h */ +#warning TODO: remove Flags - we have conf instead FlagType Flags; char *Name, /* name of board */ *Filename, /* name of file (from load) */ Index: trunk/src/gui_act.c =================================================================== --- trunk/src/gui_act.c (revision 1807) +++ trunk/src/gui_act.c (revision 1808) @@ -207,6 +207,7 @@ return shape; } +#define TOGGLE_CONF(field) conf_core.editor.field = !conf_core.editor.field static int ActionDisplay(int argc, char **argv, Coord childX, Coord childY) { char *function, *str_dir; @@ -234,15 +235,15 @@ EraseElementName(element); } END_LOOP; - CLEAR_FLAG(DESCRIPTIONFLAG | NAMEONPCBFLAG, PCB); + conf_core.editor.description = conf_core.editor.name_on_pcb = 0; switch (id) { case F_Value: break; case F_NameOnPCB: - SET_FLAG(NAMEONPCBFLAG, PCB); + conf_core.editor.name_on_pcb = 1; break; case F_Description: - SET_FLAG(DESCRIPTIONFLAG, PCB); + conf_core.editor.description = 1; break; } ELEMENT_LOOP(PCB->Data); @@ -255,15 +256,14 @@ /* toggle line-adjust flag */ case F_ToggleAllDirections: - TOGGLE_FLAG(ALLDIRECTIONFLAG, PCB); + TOGGLE_CONF(all_direction_lines); AdjustAttachedObjects(); break; case F_CycleClip: notify_crosshair_change(false); - if TEST_FLAG - (ALLDIRECTIONFLAG, PCB) { - TOGGLE_FLAG(ALLDIRECTIONFLAG, PCB); + if (conf_core.editor.all_direction_lines) { + TOGGLE_CONF(all_direction_lines); PCB->Clipping = 0; } else @@ -282,84 +282,83 @@ case F_ToggleRubberBandMode: notify_crosshair_change(false); - TOGGLE_FLAG(RUBBERBANDFLAG, PCB); + TOGGLE_CONF(rubber_band_mode); notify_crosshair_change(true); break; case F_ToggleStartDirection: notify_crosshair_change(false); - TOGGLE_FLAG(SWAPSTARTDIRFLAG, PCB); + TOGGLE_CONF(swap_start_direction); notify_crosshair_change(true); break; case F_ToggleUniqueNames: - TOGGLE_FLAG(UNIQUENAMEFLAG, PCB); + TOGGLE_CONF(unique_names); break; case F_ToggleSnapPin: notify_crosshair_change(false); - TOGGLE_FLAG(SNAPPINFLAG, PCB); + TOGGLE_CONF(snap_pin); notify_crosshair_change(true); break; case F_ToggleSnapOffGridLine: notify_crosshair_change(false); - TOGGLE_FLAG(SNAPOFFGRIDLINEFLAG, PCB); + TOGGLE_CONF(snap_offgrid_line); notify_crosshair_change(true); break; case F_ToggleHighlightOnPoint: notify_crosshair_change(false); - TOGGLE_FLAG(HIGHLIGHTONPOINTFLAG, PCB); + TOGGLE_CONF(highlight_on_point); notify_crosshair_change(true); break; case F_ToggleLocalRef: - TOGGLE_FLAG(LOCALREFFLAG, PCB); + TOGGLE_CONF(local_ref); break; case F_ToggleThindraw: - TOGGLE_FLAG(THINDRAWFLAG, PCB); + TOGGLE_CONF(thin_draw); Redraw(); break; case F_ToggleThindrawPoly: - TOGGLE_FLAG(THINDRAWPOLYFLAG, PCB); + TOGGLE_CONF(thin_draw_poly); Redraw(); break; case F_ToggleLockNames: - TOGGLE_FLAG(LOCKNAMESFLAG, PCB); - CLEAR_FLAG(ONLYNAMESFLAG, PCB); + TOGGLE_CONF(lock_names); + conf_core.editor.only_names = 0; break; case F_ToggleOnlyNames: - TOGGLE_FLAG(ONLYNAMESFLAG, PCB); - CLEAR_FLAG(LOCKNAMESFLAG, PCB); + TOGGLE_CONF(only_names); + conf_core.editor.lock_names = 0; break; case F_ToggleHideNames: - TOGGLE_FLAG(HIDENAMESFLAG, PCB); + TOGGLE_CONF(hide_names); Redraw(); break; case F_ToggleStroke: - TOGGLE_FLAG(ENABLESTROKEFLAG, PCB); - conf_core.editor.enable_stroke = TEST_FLAG(ENABLESTROKEFLAG, PCB); + TOGGLE_CONF(enable_stroke); break; case F_ToggleShowDRC: - TOGGLE_FLAG(SHOWDRCFLAG, PCB); + TOGGLE_CONF(show_drc); break; case F_ToggleLiveRoute: - TOGGLE_FLAG(LIVEROUTEFLAG, PCB); + TOGGLE_CONF(live_routing); break; case F_ToggleAutoDRC: notify_crosshair_change(false); - TOGGLE_FLAG(AUTODRCFLAG, PCB); - if (TEST_FLAG(AUTODRCFLAG, PCB) && conf_core.editor.mode == LINE_MODE) { + TOGGLE_CONF(auto_drc); + if (conf_core.editor.auto_drc && conf_core.editor.mode == LINE_MODE) { if (ResetConnections(true)) { IncrementUndoSerialNumber(); Draw(); @@ -371,30 +370,30 @@ break; case F_ToggleCheckPlanes: - TOGGLE_FLAG(CHECKPLANESFLAG, PCB); + TOGGLE_CONF(check_planes); Redraw(); break; case F_ToggleOrthoMove: - TOGGLE_FLAG(ORTHOMOVEFLAG, PCB); + TOGGLE_CONF(orthogonal_moves); break; case F_ToggleName: - TOGGLE_FLAG(SHOWNUMBERFLAG, PCB); + TOGGLE_CONF(show_number); Redraw(); break; case F_ToggleMask: - TOGGLE_FLAG(SHOWMASKFLAG, PCB); + TOGGLE_CONF(show_mask); Redraw(); break; case F_ToggleClearLine: - TOGGLE_FLAG(CLEARNEWFLAG, PCB); + TOGGLE_CONF(clear_line); break; case F_ToggleFullPoly: - TOGGLE_FLAG(NEWFULLPOLYFLAG, PCB); + TOGGLE_CONF(full_poly); break; /* shift grid alignment */ @@ -529,7 +528,7 @@ AFAIL(display); } - +#undef TOGGLE_CONF /* --------------------------------------------------------------------------- */ static const char mode_syntax[] = Index: trunk/src/insert.c =================================================================== --- trunk/src/insert.c (revision 1807) +++ trunk/src/insert.c (revision 1808) @@ -241,7 +241,7 @@ InsertedPoint.Y = myline.Point2.Y; return &InsertedPoint; } - if (TEST_FLAG(ALLDIRECTIONFLAG, PCB)) { + if (conf_core.editor.all_direction_lines) { InsertedPoint.X = Crosshair.X; InsertedPoint.Y = Crosshair.Y; return &InsertedPoint; Index: trunk/src/line.c =================================================================== --- trunk/src/line.c (revision 1807) +++ trunk/src/line.c (revision 1808) @@ -66,7 +66,7 @@ else line->draw = true; /* no 45 degree lines required */ - if (PCB->RatDraw || TEST_FLAG(ALLDIRECTIONFLAG, PCB)) { + if (PCB->RatDraw || conf_core.editor.all_direction_lines) { line->Point2.X = Crosshair.X; line->Point2.Y = Crosshair.Y; return; @@ -170,7 +170,7 @@ } else line->draw = true; - if (TEST_FLAG(ALLDIRECTIONFLAG, PCB)) { + if (conf_core.editor.all_direction_lines) { line->Point2.X = Crosshair.X; line->Point2.Y = Crosshair.Y; return; Index: trunk/src/macro.h =================================================================== --- trunk/src/macro.h (revision 1807) +++ trunk/src/macro.h (revision 1808) @@ -136,14 +136,14 @@ #define DESCRIPTION_INDEX 0 #define NAMEONPCB_INDEX 1 #define VALUE_INDEX 2 -#define NAME_INDEX(p) (TEST_FLAG(NAMEONPCBFLAG,(p)) ? NAMEONPCB_INDEX :\ - (TEST_FLAG(DESCRIPTIONFLAG, (p)) ? \ +#define NAME_INDEX() (conf_core.editor.name_on_pcb ? NAMEONPCB_INDEX :\ + (conf_core.editor.description ? \ DESCRIPTION_INDEX : VALUE_INDEX)) -#define ELEMENT_NAME(p,e) ((e)->Name[NAME_INDEX((p))].TextString) +#define ELEMENT_NAME(p,e) ((e)->Name[NAME_INDEX()].TextString) #define DESCRIPTION_NAME(e) ((e)->Name[DESCRIPTION_INDEX].TextString) #define NAMEONPCB_NAME(e) ((e)->Name[NAMEONPCB_INDEX].TextString) #define VALUE_NAME(e) ((e)->Name[VALUE_INDEX].TextString) -#define ELEMENT_TEXT(p,e) ((e)->Name[NAME_INDEX((p))]) +#define ELEMENT_TEXT(p,e) ((e)->Name[NAME_INDEX()]) #define DESCRIPTION_TEXT(e) ((e)->Name[DESCRIPTION_INDEX]) #define NAMEONPCB_TEXT(e) ((e)->Name[NAMEONPCB_INDEX]) #define VALUE_TEXT(e) ((e)->Name[VALUE_INDEX]) Index: trunk/src/misc.c =================================================================== --- trunk/src/misc.c (revision 1807) +++ trunk/src/misc.c (revision 1808) @@ -1217,7 +1217,7 @@ PCB->PinOn = false; PCB->ViaOn = false; PCB->RatOn = false; - CLEAR_FLAG(SHOWMASKFLAG, PCB); + conf_core.editor.show_mask = 0; conf_core.editor.show_solder_side = 0; for (i = argn - 1; i >= 0; i--) { @@ -1232,7 +1232,7 @@ else if (strcasecmp(args[i], "elements") == 0 || strcasecmp(args[i], "silk") == 0) PCB->ElementOn = true; else if (strcasecmp(args[i], "mask") == 0) - SET_FLAG(SHOWMASKFLAG, PCB); + conf_core.editor.show_mask = 1; else if (strcasecmp(args[i], "solderside") == 0) conf_core.editor.show_solder_side = 1; else if (isdigit((int) args[i][0])) { @@ -1613,7 +1613,7 @@ Coord mx = 0, my = 0; Crosshair.AttachedObject.RubberbandN = 0; - if (!TEST_FLAG(SNAPPINFLAG, PCB)) { + if (!conf_core.editor.snap_pin) { /* dither the grab point so that the mark, center, etc * will end up on a grid coordinate */ @@ -1625,7 +1625,7 @@ } Crosshair.AttachedObject.X = PlaceX - mx; Crosshair.AttachedObject.Y = PlaceY - my; - if (!Marked.status || TEST_FLAG(LOCALREFFLAG, PCB)) + if (!Marked.status || conf_core.editor.local_ref) SetLocalRef(PlaceX - mx, PlaceY - my, true); Crosshair.AttachedObject.State = STATE_SECOND; @@ -1638,7 +1638,7 @@ PCB->MaxHeight - (box->Y2 - Crosshair.AttachedObject.Y)); /* get all attached objects if necessary */ - if ((conf_core.editor.mode != COPY_MODE) && TEST_FLAG(RUBBERBANDFLAG, PCB)) + if ((conf_core.editor.mode != COPY_MODE) && conf_core.editor.rubber_band_mode) LookupRubberbandLines(Crosshair.AttachedObject.Type, Crosshair.AttachedObject.Ptr1, Crosshair.AttachedObject.Ptr2, Crosshair.AttachedObject.Ptr3); if (conf_core.editor.mode != COPY_MODE && Index: trunk/src/move.c =================================================================== --- trunk/src/move.c (revision 1807) +++ trunk/src/move.c (revision 1808) @@ -464,8 +464,8 @@ newone = CreateNewLineOnLayer(Dest, Rat->Point1.X, Rat->Point1.Y, Rat->Point2.X, Rat->Point2.Y, conf_core.design.line_thickness, 2 * conf_core.design.keepaway, Rat->Flags); - if (TEST_FLAG(CLEARNEWFLAG, PCB)) - SET_FLAG(CLEARLINEFLAG, newone); + if (conf_core.editor.clear_line) + conf_core.editor.clear_line = 1; if (!newone) return (NULL); AddObjectToCreateUndoList(LINE_TYPE, Dest, newone, newone); Index: trunk/src/object_act.c =================================================================== --- trunk/src/object_act.c (revision 1807) +++ trunk/src/object_act.c (revision 1808) @@ -393,7 +393,7 @@ if (absolute2) ny -= y; Crosshair.AttachedObject.RubberbandN = 0; - if (TEST_FLAG(RUBBERBANDFLAG, PCB)) + if (conf_core.editor.rubber_band_mode) LookupRubberbandLines(type, ptr1, ptr2, ptr3); if (type == ELEMENT_TYPE) LookupRatLines(type, ptr1, ptr2, ptr3); Index: trunk/src/polygon.c =================================================================== --- trunk/src/polygon.c (revision 1807) +++ trunk/src/polygon.c (revision 1808) @@ -1307,7 +1307,7 @@ /* if 45 degree lines are what we want do a quick check * if closing the polygon makes sense */ - if (!TEST_FLAG(ALLDIRECTIONFLAG, PCB)) { + if (!conf_core.editor.all_direction_lines) { Coord dx, dy; dx = abs(Crosshair.AttachedPolygon.Points[n - 1].X - Crosshair.AttachedPolygon.Points[0].X); @@ -1338,7 +1338,7 @@ *polygon = Crosshair.AttachedPolygon; polygon->ID = saveID; SET_FLAG(CLEARPOLYFLAG, polygon); - if (TEST_FLAG(NEWFULLPOLYFLAG, PCB)) + if (conf_core.editor.full_poly) SET_FLAG(FULLPOLYFLAG, polygon); memset(&Crosshair.AttachedPolygon, 0, sizeof(PolygonType)); SetPolygonBoundingBox(polygon); Index: trunk/src/rotate.c =================================================================== --- trunk/src/rotate.c (revision 1807) +++ trunk/src/rotate.c (revision 1808) @@ -49,6 +49,7 @@ #include "select.h" #include "set.h" #include "undo.h" +#include "conf_core.h" RCSID("$Id$"); @@ -389,7 +390,7 @@ return; } Crosshair.AttachedObject.RubberbandN = 0; - if (TEST_FLAG(RUBBERBANDFLAG, PCB)) + if (conf_core.editor.rubber_band_mode) LookupRubberbandLines(type, ptr1, ptr2, ptr3); if (type == ELEMENT_TYPE) LookupRatLines(type, ptr1, ptr2, ptr3); Index: trunk/src/search.c =================================================================== --- trunk/src/search.c (revision 1807) +++ trunk/src/search.c (revision 1808) @@ -500,7 +500,7 @@ info.area = SQUARE(MAX_COORD); info.BackToo = (BackToo && PCB->InvisibleObjectsOn); info.locked = (locked & LOCKED_TYPE) ? 0 : LOCKFLAG; - if (r_search(PCB->Data->name_tree[NAME_INDEX(PCB)], &SearchBox, NULL, name_callback, &info)) + if (r_search(PCB->Data->name_tree[NAME_INDEX()], &SearchBox, NULL, name_callback, &info)) return true; } return (false); @@ -1015,16 +1015,16 @@ SearchBox = point_box(X, Y); } - if (TEST_FLAG(LOCKNAMESFLAG, PCB)) { + if (conf_core.editor.lock_names) { Type &= ~(ELEMENTNAME_TYPE | TEXT_TYPE); } - if (TEST_FLAG(HIDENAMESFLAG, PCB)) { + if (conf_core.editor.hide_names) { Type &= ~ELEMENTNAME_TYPE; } - if (TEST_FLAG(ONLYNAMESFLAG, PCB)) { + if (conf_core.editor.only_names) { Type &= (ELEMENTNAME_TYPE | TEXT_TYPE); } - if (TEST_FLAG(THINDRAWFLAG, PCB) || TEST_FLAG(THINDRAWPOLYFLAG, PCB)) { + if (conf_core.editor.thin_draw || conf_core.editor.thin_draw_poly) { Type &= ~POLYGON_TYPE; } Index: trunk/src/set.c =================================================================== --- trunk/src/set.c (revision 1807) +++ trunk/src/set.c (revision 1808) @@ -84,7 +84,7 @@ { if (Size >= MIN_LINESIZE && Size <= MAX_LINESIZE) { conf_core.design.line_thickness = Size; - if (TEST_FLAG(AUTODRCFLAG, PCB)) + if (conf_core.editor.auto_drc) FitCrosshairIntoGrid(Crosshair.X, Crosshair.Y); } } @@ -242,7 +242,7 @@ SetLocalRef(0, 0, false); Crosshair.AttachedBox.State = STATE_FIRST; Crosshair.AttachedLine.State = STATE_FIRST; - if (Mode == LINE_MODE && TEST_FLAG(AUTODRCFLAG, PCB)) { + if (Mode == LINE_MODE && conf_core.editor.auto_drc) { if (ResetConnections(true)) { IncrementUndoSerialNumber(); Draw(); Index: trunk/src/strflags.c =================================================================== --- trunk/src/strflags.c (revision 1807) +++ trunk/src/strflags.c (revision 1808) @@ -59,22 +59,7 @@ * Thermals are handled separately, as they're layer-selective. */ -typedef struct { - - /* This is the bit that we're setting. */ - int mask; - - /* The name used in the output file. */ - char *name; - int nlen; #define N(x) x, sizeof(x)-1 - - /* If set, this entry won't be output unless the object type is one - of these. */ - int object_types; - -} FlagBitsType; - static FlagBitsType object_flagbits[] = { {PINFLAG, N("pin"), ALL_TYPES}, {VIAFLAG, N("via"), ALL_TYPES}, @@ -84,8 +69,11 @@ {PININPOLYFLAG, N("pininpoly"), PIN_TYPES | PAD_TYPE}, {CLEARPOLYFLAG, N("clearpoly"), POLYGON_TYPE}, {HIDENAMEFLAG, N("hidename"), ELEMENT_TYPE}, +#warning TODO: do we need these? +/* {SNAPOFFGRIDLINEFLAG, N("snapoffgridline"), ALL_TYPES}, {HIGHLIGHTONPOINTFLAG, N("highlightonpoint"), ALL_TYPES}, +*/ {DISPLAYNAMEFLAG, N("showname"), ELEMENT_TYPE}, {CLEARLINEFLAG, N("clearline"), LINE_TYPE | ARC_TYPE | TEXT_TYPE}, {SELECTEDFLAG, N("selected"), ALL_TYPES}, @@ -103,36 +91,6 @@ {NOPASTEFLAG, N("nopaste"), PAD_TYPE}, {NONETLISTFLAG, N("nonetlist"), ALL_TYPES} }; - -#warning TODO: move this to io_pcb -/* NEVER USE THESE FROM ANYWHERE ELSE THAN io_pcb */ -static FlagBitsType pcb_flagbits[] = { - {SHOWNUMBERFLAG, N("shownumber"), 1}, - {LOCALREFFLAG, N("localref"), 1}, - {CHECKPLANESFLAG, N("checkplanes"), 1}, - {SHOWDRCFLAG, N("showdrc"), 1}, - {RUBBERBANDFLAG, N("rubberband"), 1}, - {DESCRIPTIONFLAG, N("description"), 1}, - {NAMEONPCBFLAG, N("nameonpcb"), 1}, - {AUTODRCFLAG, N("autodrc"), 1}, - {ALLDIRECTIONFLAG, N("alldirection"), 1}, - {SWAPSTARTDIRFLAG, N("swapstartdir"), 1}, - {UNIQUENAMEFLAG, N("uniquename"), 1}, - {CLEARNEWFLAG, N("clearnew"), 1}, - {NEWFULLPOLYFLAG, N("newfullpoly"), 1}, - {SNAPPINFLAG, N("snappin"), 1}, - {SHOWMASKFLAG, N("showmask"), 1}, - {THINDRAWFLAG, N("thindraw"), 1}, - {ORTHOMOVEFLAG, N("orthomove"), 1}, - {LIVEROUTEFLAG, N("liveroute"), 1}, - {THINDRAWPOLYFLAG, N("thindrawpoly"), 1}, - {LOCKNAMESFLAG, N("locknames"), 1}, - {ONLYNAMESFLAG, N("onlynames"), 1}, - {HIDENAMESFLAG, N("hidenames"), 1}, - {ENABLEMINCUTFLAG, N("enablemincut"), 1}, - {ENABLESTROKEFLAG, N("enablestroke"), 1} -}; - #undef N /* @@ -371,7 +329,7 @@ static FlagType empty_flags; -static FlagType +FlagType common_string_to_flags(const char *flagstring, int (*error) (const char *msg), FlagBitsType * flagbits, int n_flagbits) { const char *fp, *ep; @@ -462,13 +420,7 @@ return common_string_to_flags(flagstring, error, object_flagbits, ENTRIES(object_flagbits)); } -#warning TODO: move this to io_pcb -FlagType string_to_pcbflags(const char *flagstring, int (*error) (const char *msg)) -{ - return common_string_to_flags(flagstring, error, pcb_flagbits, ENTRIES(pcb_flagbits)); -} - /* * Given a set of flags for a given type of object, return a string * which reflects those flags. The only requirement is that this @@ -480,7 +432,7 @@ * forcibly set when vias are parsed. */ -static char *common_flags_to_string(FlagType flags, int object_type, FlagBitsType * flagbits, int n_flagbits) +char *common_flags_to_string(FlagType flags, int object_type, FlagBitsType * flagbits, int n_flagbits) { int len; int i; @@ -599,8 +551,3 @@ return common_flags_to_string(flags, object_type, object_flagbits, ENTRIES(object_flagbits)); } -char *pcbflags_to_string(FlagType flags) -{ - return common_flags_to_string(flags, ALL_TYPES, pcb_flagbits, ENTRIES(pcb_flagbits)); -} - Index: trunk/src/strflags.h =================================================================== --- trunk/src/strflags.h (revision 1807) +++ trunk/src/strflags.h (revision 1808) @@ -28,6 +28,25 @@ #ifndef PCB_STRFLAGS_H #define PCB_STRFLAGS_H +/* for flagtype */ +#include "global_objs.h" + +typedef struct { + + /* This is the bit that we're setting. */ + int mask; + + /* The name used in the output file. */ + char *name; + int nlen; + + /* If set, this entry won't be output unless the object type is one + of these. */ + int object_types; + +} FlagBitsType; + + /* The purpose of this interface is to make the file format able to handle more than 32 flags, and to hide the internal details of flags from the file format. */ @@ -49,4 +68,8 @@ void uninit_strflags_buf(void); void uninit_strflags_layerlist(void); +/* io_pcb() needs this for historic reasons */ +FlagType common_string_to_flags(const char *flagstring, int (*error) (const char *msg), FlagBitsType * flagbits, int n_flagbits); +char *common_flags_to_string(FlagType flags, int object_type, FlagBitsType * flagbits, int n_flagbits); + #endif Index: trunk/src/undo.c =================================================================== --- trunk/src/undo.c (revision 1807) +++ trunk/src/undo.c (revision 1808) @@ -67,6 +67,7 @@ #include "set.h" #include "undo.h" #include "strflags.h" +#include "conf_core.h" RCSID("$Id$"); @@ -847,8 +848,8 @@ int unique; bool error_undoing = false; - unique = TEST_FLAG(UNIQUENAMEFLAG, PCB); - CLEAR_FLAG(UNIQUENAMEFLAG, PCB); + unique = conf_core.editor.unique_names; + conf_core.editor.unique_names = 0; /* NOTE: intentinal bypass of the conf system for temporary change of a flag */ andDraw = draw; @@ -900,8 +901,7 @@ Draw(); /* restore the unique flag setting */ - if (unique) - SET_FLAG(UNIQUENAMEFLAG, PCB); + conf_core.editor.unique_names = unique; return Types; } Index: trunk/src/undo_act.c =================================================================== --- trunk/src/undo_act.c (revision 1807) +++ trunk/src/undo_act.c (revision 1808) @@ -146,7 +146,7 @@ /* move anchor point if undoing during line creation */ if (conf_core.editor.mode == LINE_MODE) { if (Crosshair.AttachedLine.State == STATE_SECOND) { - if (TEST_FLAG(AUTODRCFLAG, PCB)) + if (conf_core.editor.auto_drc) Undo(true); /* undo the connection find */ Crosshair.AttachedLine.State = STATE_FIRST; SetLocalRef(0, 0, false); @@ -184,7 +184,7 @@ SearchObjectByLocation(LINE_TYPE | RATLINE_TYPE, &ptr1, &ptrtmp, &ptr3, Crosshair.AttachedLine.Point2.X, Crosshair.AttachedLine.Point2.Y, 0); ptr2 = (LineTypePtr) ptrtmp; - if (TEST_FLAG(AUTODRCFLAG, PCB)) { + if (conf_core.editor.auto_drc) { /* undo loses FOUNDFLAG */ SET_FLAG(FOUNDFLAG, ptr2); DrawLine(CURRENT, ptr2); Index: trunk/src_plugins/autoroute/autoroute.c =================================================================== --- trunk/src_plugins/autoroute/autoroute.c (revision 1807) +++ trunk/src_plugins/autoroute/autoroute.c (revision 1808) @@ -2842,7 +2842,7 @@ int ka = AutoRouteParameters.style->Keepaway; PinType *live_via = NULL; - if (TEST_FLAG(LIVEROUTEFLAG, PCB)) { + if (conf_core.editor.live_routing) { live_via = CreateNewVia(PCB->Data, X, Y, radius * 2, 2 * AutoRouteParameters.style->Keepaway, 0, AutoRouteParameters.style->Hole, NULL, MakeFlags(0)); if (live_via != NULL) @@ -2969,7 +2969,7 @@ /* and add it to the r-tree! */ r_insert_entry(rd->layergrouptree[rb->group], &rb->box, 1); - if (TEST_FLAG(LIVEROUTEFLAG, PCB)) { + if (conf_core.editor.live_routing) { LayerType *layer = LAYER_PTR(PCB->LayerGroups.Entries[rb->group][0]); LineType *line = CreateNewLineOnLayer(layer, qX1, qY1, qX2, qY2, 2 * qhthick, 0, MakeFlags(0)); @@ -3242,7 +3242,7 @@ /* flush the line queue */ RD_DrawLine(rd, -1, 0, 0, 0, 0, 0, NULL, false, false); - if (TEST_FLAG(LIVEROUTEFLAG, PCB)) + if (conf_core.editor.live_routing) Draw(); #ifdef ROUTE_DEBUG @@ -4200,7 +4200,7 @@ mtspace_add(rd->mtspace, &p->box, p->flags.is_odd ? EVEN : ODD, p->style->Keepaway); } if (rip) { - if (TEST_FLAG(LIVEROUTEFLAG, PCB)) + if (conf_core.editor.live_routing) ripout_livedraw_obj(p); #ifndef NDEBUG del = @@ -4215,7 +4215,7 @@ } } END_LOOP; - if (TEST_FLAG(LIVEROUTEFLAG, PCB)) + if (conf_core.editor.live_routing) Draw(); /* reset to original connectivity */ if (rip) { @@ -4457,7 +4457,7 @@ /* using CreateDrawn instead of CreateNew concatenates sequential lines */ p->parent.line = CreateDrawnLineOnLayer (layer, b.X1, b.Y1, b.X2, b.Y2, - p->style->Thick, p->style->Keepaway * 2, MakeFlags(AUTOFLAG | (TEST_FLAG(CLEARNEWFLAG, PCB) ? CLEARLINEFLAG : 0))); + p->style->Thick, p->style->Keepaway * 2, MakeFlags(AUTOFLAG | (conf_core.editor.clear_line ? CLEARLINEFLAG : 0))); if (p->parent.line) { AddObjectToCreateUndoList(LINE_TYPE, layer, p->parent.line, p->parent.line); @@ -4671,7 +4671,7 @@ changed = (RouteAll(rd).total_nets_routed > 0) || changed; donerouting: gui->progress(0, 0, NULL); - if (TEST_FLAG(LIVEROUTEFLAG, PCB)) { + if (conf_core.editor.live_routing) { int i; BoxType big = { 0, 0, MAX_COORD, MAX_COORD }; for (i = 0; i < max_group; i++) { Index: trunk/src_plugins/export_gerber/gerber.c =================================================================== --- trunk/src_plugins/export_gerber/gerber.c (revision 1807) +++ trunk/src_plugins/export_gerber/gerber.c (revision 1808) @@ -34,6 +34,7 @@ #include "hid_init.h" #include "hid_attrib.h" #include "hid_flags.h" +#include "conf_core.h" RCSID("$Id$"); @@ -511,12 +512,11 @@ int i; static int saved_layer_stack[MAX_LAYER]; int save_ons[MAX_LAYER + 2]; - FlagType save_thindraw; - save_thindraw = PCB->Flags; - CLEAR_FLAG(THINDRAWFLAG, PCB); - CLEAR_FLAG(THINDRAWPOLYFLAG, PCB); - CLEAR_FLAG(CHECKPLANESFLAG, PCB); + /* NOTE: it's OK to change flags bypassing conf - we will use conf to restore them */ + conf_core.editor.thin_draw = 0; + conf_core.editor.thin_draw_poly = 0; + conf_core.editor.check_planes = 0; if (!options) { gerber_get_export_options(NULL); @@ -600,7 +600,7 @@ maybe_close_f(f); f = NULL; hid_restore_layer_ons(save_ons); - PCB->Flags = save_thindraw; + conf_update(); } static void gerber_parse_arguments(int *argc, char ***argv) Index: trunk/src_plugins/export_png/png.c =================================================================== --- trunk/src_plugins/export_png/png.c (revision 1807) +++ trunk/src_plugins/export_png/png.c (revision 1808) @@ -426,9 +426,7 @@ { int i; static int saved_layer_stack[MAX_LAYER]; - int saved_show_solder_side; BoxType region; - FlagType save_flags; f = the_file; @@ -457,25 +455,23 @@ print_layer[i] = 1; memcpy(saved_layer_stack, LayerStack, sizeof(LayerStack)); - save_flags = PCB->Flags; - saved_show_solder_side = conf_core.editor.show_solder_side; as_shown = options[HA_as_shown].int_value; if (!options[HA_as_shown].int_value) { - CLEAR_FLAG(SHOWMASKFLAG, PCB); -#warning TODO: this should not happen here + /* NOTE: it's OK to change flags bypassing conf - we will use conf to restore them */ + conf_core.editor.thin_draw = 0; + conf_core.editor.thin_draw_poly = 0; +/* conf_core.editor.check_planes = 0;*/ conf_core.editor.show_solder_side = 0; + conf_core.editor.show_mask = 0; comp_layer = GetLayerGroupNumberByNumber(component_silk_layer); solder_layer = GetLayerGroupNumberByNumber(solder_silk_layer); qsort(LayerStack, max_copper_layer, sizeof(LayerStack[0]), layer_sort); - CLEAR_FLAG(THINDRAWFLAG, PCB); - CLEAR_FLAG(THINDRAWPOLYFLAG, PCB); - if (photo_mode) { int i, n = 0; - SET_FLAG(SHOWMASKFLAG, PCB); + conf_core.editor.show_mask = 1; photo_has_inners = 0; if (comp_layer < solder_layer) for (i = comp_layer; i <= solder_layer; i++) { @@ -524,8 +520,7 @@ hid_expose_callback(&png_hid, bounds, 0); memcpy(LayerStack, saved_layer_stack, sizeof(LayerStack)); - PCB->Flags = save_flags; - conf_core.editor.show_solder_side = saved_show_solder_side; + conf_update(); } static void blend(color_struct * dest, float a_amount, color_struct * a, color_struct * b) @@ -1055,7 +1050,7 @@ case SL(MASK, TOP): case SL(MASK, BOTTOM): - return TEST_FLAG(SHOWMASKFLAG, PCB) && SL_MYSIDE(idx); + return conf_core.editor.show_mask && SL_MYSIDE(idx); } } else { Index: trunk/src_plugins/export_ps/eps.c =================================================================== --- trunk/src_plugins/export_ps/eps.c (revision 1807) +++ trunk/src_plugins/export_ps/eps.c (revision 1808) @@ -186,12 +186,11 @@ int i; static int saved_layer_stack[MAX_LAYER]; BoxType region; - FlagType save_thindraw; - save_thindraw = PCB->Flags; - CLEAR_FLAG(THINDRAWFLAG, PCB); - CLEAR_FLAG(THINDRAWPOLYFLAG, PCB); - CLEAR_FLAG(CHECKPLANESFLAG, PCB); + /* NOTE: it's OK to change flags bypassing conf - we will use conf to restore them */ + conf_core.editor.thin_draw = 0; + conf_core.editor.thin_draw_poly = 0; + conf_core.editor.check_planes = 0; f = the_file; @@ -305,7 +304,7 @@ fprintf(f, "%%%%EOF\n"); memcpy(LayerStack, saved_layer_stack, sizeof(LayerStack)); - PCB->Flags = save_thindraw; + conf_update(); } static void eps_do_export(HID_Attr_Val * options) Index: trunk/src_plugins/export_ps/ps.c =================================================================== --- trunk/src_plugins/export_ps/ps.c (revision 1807) +++ trunk/src_plugins/export_ps/ps.c (revision 1808) @@ -28,6 +28,7 @@ #include "hid_helper.h" #include "hid_flags.h" #include "hid_actions.h" +#include "conf_core.h" RCSID("$Id$"); @@ -600,12 +601,11 @@ { int i; static int saved_layer_stack[MAX_LAYER]; - FlagType save_thindraw; - save_thindraw = PCB->Flags; - CLEAR_FLAG(THINDRAWFLAG, PCB); - CLEAR_FLAG(THINDRAWPOLYFLAG, PCB); - CLEAR_FLAG(CHECKPLANESFLAG, PCB); + /* NOTE: it's OK to change flags bypassing conf - we will use conf to restore them */ + conf_core.editor.thin_draw = 0; + conf_core.editor.thin_draw_poly = 0; + conf_core.editor.check_planes = 0; global.f = the_file; global.drill_helper = options[HA_drillhelper].int_value; @@ -701,7 +701,7 @@ fprintf(the_file, "showpage\n"); memcpy(LayerStack, saved_layer_stack, sizeof(LayerStack)); - PCB->Flags = save_thindraw; + conf_update(); } static void ps_do_export(HID_Attr_Val * options) Index: trunk/src_plugins/gpmi/pcb-gpmi/gpmi_plugin/gpmi_pkg/layout/create.c =================================================================== --- trunk/src_plugins/gpmi/pcb-gpmi/gpmi_plugin/gpmi_pkg/layout/create.c (revision 1807) +++ trunk/src_plugins/gpmi/pcb-gpmi/gpmi_plugin/gpmi_pkg/layout/create.c (revision 1808) @@ -11,6 +11,8 @@ } flag_tr_t; static flag_tr_t flags[] = { +#warning TODO: get these from conf +#if 0 {1, FL_SHOWNUMBER, SHOWNUMBERFLAG}, {1, FL_LOCALREF, LOCALREFFLAG}, {1, FL_CHECKPLANS, CHECKPLANESFLAG}, @@ -33,6 +35,7 @@ {1, FL_ONLYNAMES, ONLYNAMESFLAG}, {1, FL_NEWFULLPOLY, NEWFULLPOLYFLAG}, {1, FL_HIDENAMES, HIDENAMESFLAG}, +#endif {0, FL_THERMALSTYLE1, 1}, {0, FL_THERMALSTYLE2, 2}, Index: trunk/src_plugins/hid_gtk/gtkhid-gdk.c =================================================================== --- trunk/src_plugins/hid_gtk/gtkhid-gdk.c (revision 1807) +++ trunk/src_plugins/hid_gtk/gtkhid-gdk.c (revision 1808) @@ -85,7 +85,7 @@ return /* pinout ? 0 : */ PCB->InvisibleObjectsOn; case SL_MASK: if (SL_MYSIDE(idx) /*&& !pinout */ ) - return TEST_FLAG(SHOWMASKFLAG, PCB); + return conf_core.editor.show_mask; return 0; case SL_SILK: if (SL_MYSIDE(idx) /*|| pinout */ ) Index: trunk/src_plugins/hid_gtk/gui-misc.c =================================================================== --- trunk/src_plugins/hid_gtk/gui-misc.c (revision 1807) +++ trunk/src_plugins/hid_gtk/gui-misc.c (revision 1808) @@ -355,7 +355,7 @@ */ void ghid_set_status_line_label(void) { - gchar *flag = TEST_FLAG(ALLDIRECTIONFLAG, PCB) + gchar *flag = conf_core.editor.all_direction_lines ? "all" : (PCB->Clipping == 0 ? "45" : (PCB->Clipping == 1 ? "45_/" : "45\\_")); char *text = pcb_strdup_printf(_("%m+view=%s " "grid=%$mS " @@ -366,7 +366,7 @@ conf_core.editor.grid_unit->allow, conf_core.editor.show_solder_side ? _("solder") : _("component"), PCB->Grid, - flag, TEST_FLAG(RUBBERBANDFLAG, PCB) ? ",R " : " ", + flag, conf_core.editor.rubber_band_mode ? ",R " : " ", conf_core.design.line_thickness, conf_core.design.via_thickness, conf_core.design.via_drilling_hole, Index: trunk/src_plugins/hid_gtk/gui-top-window.c =================================================================== --- trunk/src_plugins/hid_gtk/gui-top-window.c (revision 1807) +++ trunk/src_plugins/hid_gtk/gui-top-window.c (revision 1808) @@ -429,7 +429,7 @@ case LAYER_BUTTON_MASK: *color_string = conf_core.appearance.color.mask; *text = _("solder mask"); - *set = TEST_FLAG(SHOWMASKFLAG, PCB); + *set = conf_core.editor.show_mask; break; default: /* layers */ *color_string = conf_core.appearance.color.layer[i]; @@ -496,10 +496,11 @@ redraw = TRUE; break; case LAYER_BUTTON_MASK: +#warning TODO: don't write directly if (active) - SET_FLAG(SHOWMASKFLAG, PCB); + conf_core.editor.show_mask = 1; else - CLEAR_FLAG(SHOWMASKFLAG, PCB); + conf_core.editor.show_mask = 0; redraw = TRUE; break; default: Index: trunk/src_plugins/hid_lesstif/main.c =================================================================== --- trunk/src_plugins/hid_lesstif/main.c (revision 1807) +++ trunk/src_plugins/hid_lesstif/main.c (revision 1808) @@ -313,9 +313,9 @@ static char *cur_clip() { - if (TEST_FLAG(ORTHOMOVEFLAG, PCB)) + if (conf_core.editor.orthogonal_moves) return "+"; - if (TEST_FLAG(ALLDIRECTIONFLAG, PCB)) + if (conf_core.editor.all_direction_lines) return "*"; if (PCB->Clipping == 0) return "X"; @@ -2854,7 +2854,7 @@ return pinout ? 0 : PCB->InvisibleObjectsOn; case SL_MASK: if (SL_MYSIDE(idx) && !pinout) - return TEST_FLAG(SHOWMASKFLAG, PCB); + return conf_core.editor.show_mask; return 0; case SL_SILK: if (SL_MYSIDE(idx) || pinout) @@ -2890,7 +2890,7 @@ static void lesstif_use_mask(int use_it) { - if ((TEST_FLAG(THINDRAWFLAG, PCB) || TEST_FLAG(THINDRAWPOLYFLAG, PCB)) && !use_xrender) + if ((conf_core.editor.thin_draw || conf_core.editor.thin_draw_poly) && !use_xrender) use_it = 0; if ((use_it == 0) == (use_mask == 0)) return; @@ -3063,7 +3063,7 @@ { double dx1, dy1, dx2, dy2; int vw = Vz(gc->width); - if ((pinout || TEST_FLAG(THINDRAWFLAG, PCB) || TEST_FLAG(THINDRAWPOLYFLAG, PCB)) && gc->erase) + if ((pinout || conf_core.editor.thin_draw || conf_core.editor.thin_draw_poly) && gc->erase) return; #if 0 pcb_printf("draw_line %#mD-%#mD @%#mS", x1, y1, x2, y2, gc->width); @@ -3101,7 +3101,7 @@ static void lesstif_draw_arc(hidGC gc, Coord cx, Coord cy, Coord width, Coord height, Angle start_angle, Angle delta_angle) { - if ((pinout || TEST_FLAG(THINDRAWFLAG, PCB)) && gc->erase) + if ((pinout || conf_core.editor.thin_draw) && gc->erase) return; #if 0 pcb_printf("draw_arc %#mD %#mSx%#mS s %d d %d", cx, cy, width, height, start_angle, delta_angle); @@ -3126,13 +3126,13 @@ #endif set_gc(gc); XDrawArc(display, pixmap, my_gc, cx, cy, width * 2, height * 2, (start_angle + 180) * 64, delta_angle * 64); - if (use_mask && !TEST_FLAG(THINDRAWFLAG, PCB)) + if (use_mask && !conf_core.editor.thin_draw) XDrawArc(display, mask_bitmap, mask_gc, cx, cy, width * 2, height * 2, (start_angle + 180) * 64, delta_angle * 64); +#warning TODO: make this #if a flag and add it in the gtk hid as well #if 0 /* Enable this if you want to see the center and radii of drawn arcs, for debugging. */ - if (TEST_FLAG(THINDRAWFLAG, PCB) - && delta_angle != 360) { + if (conf_core.editor.thin_draw && (delta_angle != 360)) { cx += width; cy += height; XDrawLine(display, pixmap, arc1_gc, cx, cy, @@ -3147,7 +3147,7 @@ static void lesstif_draw_rect(hidGC gc, Coord x1, Coord y1, Coord x2, Coord y2) { int vw = Vz(gc->width); - if ((pinout || TEST_FLAG(THINDRAWFLAG, PCB)) && gc->erase) + if ((pinout || conf_core.editor.thin_draw) && gc->erase) return; x1 = Vx(x1); y1 = Vy(y1); @@ -3181,7 +3181,7 @@ { if (pinout && use_mask && gc->erase) return; - if ((TEST_FLAG(THINDRAWFLAG, PCB) || TEST_FLAG(THINDRAWPOLYFLAG, PCB)) && gc->erase) + if ((conf_core.editor.thin_draw || conf_core.editor.thin_draw_poly) && gc->erase) return; #if 0 pcb_printf("fill_circle %#mD %#mS", cx, cy, radius); @@ -3232,7 +3232,7 @@ static void lesstif_fill_rect(hidGC gc, Coord x1, Coord y1, Coord x2, Coord y2) { int vw = Vz(gc->width); - if ((pinout || TEST_FLAG(THINDRAWFLAG, PCB)) && gc->erase) + if ((pinout || conf_core.editor.thin_draw) && gc->erase) return; x1 = Vx(x1); y1 = Vy(y1); Index: trunk/src_plugins/hid_lesstif/menu.c =================================================================== --- trunk/src_plugins/hid_lesstif/menu.c (revision 1807) +++ trunk/src_plugins/hid_lesstif/menu.c (revision 1808) @@ -143,7 +143,7 @@ set = PCB->InvisibleObjectsOn; break; case LB_MASK: - set = TEST_FLAG(SHOWMASKFLAG, PCB); + set = conf_core.editor.show_mask; break; default: /* layers */ set = PCB->Data->Layer[i].On; @@ -247,8 +247,9 @@ set = PCB->InvisibleObjectsOn = !PCB->InvisibleObjectsOn; break; case LB_MASK: - TOGGLE_FLAG(SHOWMASKFLAG, PCB); - set = TEST_FLAG(SHOWMASKFLAG, PCB); +#warning TODO: do not modify directly + conf_core.editor.show_mask = !conf_core.editor.show_mask; + set = conf_core.editor.show_mask; break; default: /* layers */ set = PCB->Data->Layer[layer].On = !PCB->Data->Layer[layer].On; Index: trunk/src_plugins/io_pcb/Plug.tmpasm =================================================================== --- trunk/src_plugins/io_pcb/Plug.tmpasm (revision 1807) +++ trunk/src_plugins/io_pcb/Plug.tmpasm (revision 1808) @@ -1,5 +1,5 @@ put /local/pcb/mod {io_pcb} -put /local/pcb/mod/OBJS [@ $(PLUGDIR)/io_pcb/io_pcb.o $(PLUGDIR)/io_pcb/file.o $(PLUGDIR)/io_pcb/parse_y.o $(PLUGDIR)/io_pcb/parse_l.o @] +put /local/pcb/mod/OBJS [@ $(PLUGDIR)/io_pcb/io_pcb.o $(PLUGDIR)/io_pcb/file.o $(PLUGDIR)/io_pcb/parse_y.o $(PLUGDIR)/io_pcb/parse_l.o $(PLUGDIR)/io_pcb/flags.o @] put /local/pcb/mod/YACC {$(PLUGDIR)/io_pcb/parse_y} put /local/pcb/mod/LEX {$(PLUGDIR)/io_pcb/parse_l} Index: trunk/src_plugins/io_pcb/file.c =================================================================== --- trunk/src_plugins/io_pcb/file.c (revision 1807) +++ trunk/src_plugins/io_pcb/file.c (revision 1808) @@ -103,6 +103,7 @@ #include "stub_edif.h" #include "hid_actions.h" #include "hid_flags.h" +#include "flags.h" RCSID("$Id$"); Index: trunk/src_plugins/io_pcb/flags.c =================================================================== --- trunk/src_plugins/io_pcb/flags.c (nonexistent) +++ trunk/src_plugins/io_pcb/flags.c (revision 1808) @@ -0,0 +1,70 @@ +/* $Id$ */ +/* + * COPYRIGHT + * + * PCB, interactive printed circuit board design + * Copyright (C) 2005 DJ Delorie + * + * 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: + * DJ Delorie, 334 North Road, Deerfield NH 03037-1110, USA + * dj@delorie.com + * + */ + +#include "strflags.h" +#include "flags.h" +#include "const.h" +#include "macro.h" + +#define N(x) x, sizeof(x)-1 +static FlagBitsType pcb_flagbits[] = { + {SHOWNUMBERFLAG, N("shownumber"), 1}, + {LOCALREFFLAG, N("localref"), 1}, + {CHECKPLANESFLAG, N("checkplanes"), 1}, + {SHOWDRCFLAG, N("showdrc"), 1}, + {RUBBERBANDFLAG, N("rubberband"), 1}, + {DESCRIPTIONFLAG, N("description"), 1}, + {NAMEONPCBFLAG, N("nameonpcb"), 1}, + {AUTODRCFLAG, N("autodrc"), 1}, + {ALLDIRECTIONFLAG, N("alldirection"), 1}, + {SWAPSTARTDIRFLAG, N("swapstartdir"), 1}, + {UNIQUENAMEFLAG, N("uniquename"), 1}, + {CLEARNEWFLAG, N("clearnew"), 1}, + {NEWFULLPOLYFLAG, N("newfullpoly"), 1}, + {SNAPPINFLAG, N("snappin"), 1}, + {SHOWMASKFLAG, N("showmask"), 1}, + {THINDRAWFLAG, N("thindraw"), 1}, + {ORTHOMOVEFLAG, N("orthomove"), 1}, + {LIVEROUTEFLAG, N("liveroute"), 1}, + {THINDRAWPOLYFLAG, N("thindrawpoly"), 1}, + {LOCKNAMESFLAG, N("locknames"), 1}, + {ONLYNAMESFLAG, N("onlynames"), 1}, + {HIDENAMESFLAG, N("hidenames"), 1}, + {ENABLEMINCUTFLAG, N("enablemincut"), 1}, + {ENABLESTROKEFLAG, N("enablestroke"), 1} +}; +#undef N + +char *pcbflags_to_string(FlagType flags) +{ + return common_flags_to_string(flags, ALL_TYPES, pcb_flagbits, ENTRIES(pcb_flagbits)); +} + +FlagType string_to_pcbflags(const char *flagstring, int (*error) (const char *msg)) +{ + return common_string_to_flags(flagstring, error, pcb_flagbits, ENTRIES(pcb_flagbits)); +} Index: trunk/src_plugins/io_pcb/flags.h =================================================================== --- trunk/src_plugins/io_pcb/flags.h (nonexistent) +++ trunk/src_plugins/io_pcb/flags.h (revision 1808) @@ -0,0 +1,121 @@ +/* + * COPYRIGHT + * + * PCB, interactive printed circuit board design + * Copyright (C) 1994,1995,1996 Thomas Nau + * + * 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 + * + * RCS: $Id$ + */ + +char *pcbflags_to_string(FlagType flags); +FlagType string_to_pcbflags(const char *flagstring, int (*error) (const char *msg)); + +/* --------------------------------------------------------------------------- + * PCB flags - kept only for file format compatibility reasons; these bits + should be a mirror of booleans from the conf. + */ + +/* %start-doc pcbfile ~pcbflags +@node PCBFlags +@section PCBFlags +@table @code +@item 0x00001 +Pinout displays pin numbers instead of pin names. +@item 0x00002 +Use local reference for moves, by setting the mark at the beginning of +each move. +@item 0x00004 +When set, only polygons and their clearances are drawn, to see if +polygons have isolated regions. +@item 0x00008 +Display DRC region on crosshair. +@item 0x00010 +Do all move, mirror, rotate with rubberband connections. +@item 0x00020 +Display descriptions of elements, instead of refdes. +@item 0x00040 +Display names of elements, instead of refdes. +@item 0x00080 +Auto-DRC flag. When set, PCB doesn't let you place copper that +violates DRC. +@item 0x00100 +Enable 'all-direction' lines. +@item 0x00200 +Switch starting angle after each click. +@item 0x00400 +Force unique names on board. +@item 0x00800 +New lines/arc clear polygons. +@item 0x01000 +Crosshair snaps to pins and pads. +@item 0x02000 +Show the solder mask layer. +@item 0x04000 +Draw with thin lines. +@item 0x08000 +Move items orthogonally. +@item 0x10000 +Draw autoroute paths real-time. +@item 0x20000 +New polygons are full ones. +@item 0x40000 +Names are locked, the mouse cannot select them. +@item 0x80000 +Everything but names are locked, the mouse cannot select anything else. +@item 0x100000 +New polygons are full polygons. +@item 0x200000 +When set, element names are not drawn. ++@item 0x800000 ++snap to certain off-grid points. ++@item 0x1000000 ++highlight lines and arcs when the crosshair is on one of their endpoints. +@end table +%end-doc */ + +#define PCB_FLAGS 0x01ffffff /* all used flags */ + +#define SHOWNUMBERFLAG 0x00000001 +#define LOCALREFFLAG 0x00000002 +#define CHECKPLANESFLAG 0x00000004 +#define SHOWDRCFLAG 0x00000008 +#define RUBBERBANDFLAG 0x00000010 +#define DESCRIPTIONFLAG 0x00000020 +#define NAMEONPCBFLAG 0x00000040 +#define AUTODRCFLAG 0x00000080 +#define ALLDIRECTIONFLAG 0x00000100 +#define SWAPSTARTDIRFLAG 0x00000200 +#define UNIQUENAMEFLAG 0x00000400 +#define CLEARNEWFLAG 0x00000800 +#define SNAPPINFLAG 0x00001000 +#define SHOWMASKFLAG 0x00002000 +#define THINDRAWFLAG 0x00004000 +#define ORTHOMOVEFLAG 0x00008000 +#define LIVEROUTEFLAG 0x00010000 +#define THINDRAWPOLYFLAG 0x00020000 +#define LOCKNAMESFLAG 0x00040000 +#define ONLYNAMESFLAG 0x00080000 +#define NEWFULLPOLYFLAG 0x00100000 +#define HIDENAMESFLAG 0x00200000 +#define ENABLEMINCUTFLAG 0x00400000 +#define SNAPOFFGRIDLINEFLAG 0x00800000 +#define HIGHLIGHTONPOINTFLAG 0x01000000 +#define ENABLESTROKEFLAG 0x02000000 Index: trunk/src_plugins/io_pcb/parse_l.c =================================================================== --- trunk/src_plugins/io_pcb/parse_l.c (revision 1807) +++ trunk/src_plugins/io_pcb/parse_l.c (revision 1808) @@ -660,6 +660,7 @@ #endif #include "global.h" +#include "flags.h" #ifdef HAVE_LIBDMALLOC # include /* see http://dmalloc.com */ @@ -710,7 +711,7 @@ */ static int Parse(FILE *, char *, char *, char *, char *); -#line 714 "lex.yy.c" +#line 715 "lex.yy.c" #define INITIAL 0 @@ -897,10 +898,10 @@ register char *yy_cp, *yy_bp; register int yy_act; -#line 105 "../../src_plugins/io_pcb/parse_l.l" +#line 106 "../../src_plugins/io_pcb/parse_l.l" -#line 904 "lex.yy.c" +#line 905 "lex.yy.c" if ( !(yy_init) ) { @@ -995,227 +996,227 @@ case 1: YY_RULE_SETUP -#line 107 "../../src_plugins/io_pcb/parse_l.l" +#line 108 "../../src_plugins/io_pcb/parse_l.l" { return(T_FILEVERSION); } YY_BREAK case 2: YY_RULE_SETUP -#line 108 "../../src_plugins/io_pcb/parse_l.l" +#line 109 "../../src_plugins/io_pcb/parse_l.l" { return(T_PCB); } YY_BREAK case 3: YY_RULE_SETUP -#line 109 "../../src_plugins/io_pcb/parse_l.l" +#line 110 "../../src_plugins/io_pcb/parse_l.l" { return(T_GRID); } YY_BREAK case 4: YY_RULE_SETUP -#line 110 "../../src_plugins/io_pcb/parse_l.l" +#line 111 "../../src_plugins/io_pcb/parse_l.l" { return(T_CURSOR); } YY_BREAK case 5: YY_RULE_SETUP -#line 111 "../../src_plugins/io_pcb/parse_l.l" +#line 112 "../../src_plugins/io_pcb/parse_l.l" { return(T_THERMAL); } YY_BREAK case 6: YY_RULE_SETUP -#line 112 "../../src_plugins/io_pcb/parse_l.l" +#line 113 "../../src_plugins/io_pcb/parse_l.l" { return(T_AREA); } YY_BREAK case 7: YY_RULE_SETUP -#line 113 "../../src_plugins/io_pcb/parse_l.l" +#line 114 "../../src_plugins/io_pcb/parse_l.l" { return(T_DRC); } YY_BREAK case 8: YY_RULE_SETUP -#line 114 "../../src_plugins/io_pcb/parse_l.l" +#line 115 "../../src_plugins/io_pcb/parse_l.l" { return(T_FLAGS); } YY_BREAK case 9: YY_RULE_SETUP -#line 115 "../../src_plugins/io_pcb/parse_l.l" +#line 116 "../../src_plugins/io_pcb/parse_l.l" { return(T_LAYER); } YY_BREAK case 10: YY_RULE_SETUP -#line 116 "../../src_plugins/io_pcb/parse_l.l" +#line 117 "../../src_plugins/io_pcb/parse_l.l" { return(T_PIN); } YY_BREAK case 11: YY_RULE_SETUP -#line 117 "../../src_plugins/io_pcb/parse_l.l" +#line 118 "../../src_plugins/io_pcb/parse_l.l" { return(T_PAD); } YY_BREAK case 12: YY_RULE_SETUP -#line 118 "../../src_plugins/io_pcb/parse_l.l" +#line 119 "../../src_plugins/io_pcb/parse_l.l" { return(T_VIA); } YY_BREAK case 13: YY_RULE_SETUP -#line 119 "../../src_plugins/io_pcb/parse_l.l" +#line 120 "../../src_plugins/io_pcb/parse_l.l" { return(T_LINE); } YY_BREAK case 14: YY_RULE_SETUP -#line 120 "../../src_plugins/io_pcb/parse_l.l" +#line 121 "../../src_plugins/io_pcb/parse_l.l" { return(T_RAT); } YY_BREAK case 15: YY_RULE_SETUP -#line 121 "../../src_plugins/io_pcb/parse_l.l" +#line 122 "../../src_plugins/io_pcb/parse_l.l" { return(T_RECTANGLE); } YY_BREAK case 16: YY_RULE_SETUP -#line 122 "../../src_plugins/io_pcb/parse_l.l" +#line 123 "../../src_plugins/io_pcb/parse_l.l" { return(T_TEXT); } YY_BREAK case 17: YY_RULE_SETUP -#line 123 "../../src_plugins/io_pcb/parse_l.l" +#line 124 "../../src_plugins/io_pcb/parse_l.l" { return(T_ELEMENTLINE); } YY_BREAK case 18: YY_RULE_SETUP -#line 124 "../../src_plugins/io_pcb/parse_l.l" +#line 125 "../../src_plugins/io_pcb/parse_l.l" { return(T_ELEMENTARC); } YY_BREAK case 19: YY_RULE_SETUP -#line 125 "../../src_plugins/io_pcb/parse_l.l" +#line 126 "../../src_plugins/io_pcb/parse_l.l" { return(T_ELEMENT); } YY_BREAK case 20: YY_RULE_SETUP -#line 126 "../../src_plugins/io_pcb/parse_l.l" +#line 127 "../../src_plugins/io_pcb/parse_l.l" { return(T_SYMBOLLINE); } YY_BREAK case 21: YY_RULE_SETUP -#line 127 "../../src_plugins/io_pcb/parse_l.l" +#line 128 "../../src_plugins/io_pcb/parse_l.l" { return(T_SYMBOL); } YY_BREAK case 22: YY_RULE_SETUP -#line 128 "../../src_plugins/io_pcb/parse_l.l" +#line 129 "../../src_plugins/io_pcb/parse_l.l" { return(T_MARK); } YY_BREAK case 23: YY_RULE_SETUP -#line 129 "../../src_plugins/io_pcb/parse_l.l" +#line 130 "../../src_plugins/io_pcb/parse_l.l" { return(T_GROUPS); } YY_BREAK case 24: YY_RULE_SETUP -#line 130 "../../src_plugins/io_pcb/parse_l.l" +#line 131 "../../src_plugins/io_pcb/parse_l.l" { return(T_STYLES); } YY_BREAK case 25: YY_RULE_SETUP -#line 131 "../../src_plugins/io_pcb/parse_l.l" +#line 132 "../../src_plugins/io_pcb/parse_l.l" { return(T_POLYGON); } YY_BREAK case 26: YY_RULE_SETUP -#line 132 "../../src_plugins/io_pcb/parse_l.l" +#line 133 "../../src_plugins/io_pcb/parse_l.l" { return(T_POLYGON_HOLE); } YY_BREAK case 27: YY_RULE_SETUP -#line 133 "../../src_plugins/io_pcb/parse_l.l" +#line 134 "../../src_plugins/io_pcb/parse_l.l" { return(T_ARC); } YY_BREAK case 28: YY_RULE_SETUP -#line 134 "../../src_plugins/io_pcb/parse_l.l" +#line 135 "../../src_plugins/io_pcb/parse_l.l" { return(T_NETLIST); } YY_BREAK case 29: YY_RULE_SETUP -#line 135 "../../src_plugins/io_pcb/parse_l.l" +#line 136 "../../src_plugins/io_pcb/parse_l.l" { return(T_NET); } YY_BREAK case 30: YY_RULE_SETUP -#line 136 "../../src_plugins/io_pcb/parse_l.l" +#line 137 "../../src_plugins/io_pcb/parse_l.l" { return(T_CONN); } YY_BREAK case 31: YY_RULE_SETUP -#line 137 "../../src_plugins/io_pcb/parse_l.l" +#line 138 "../../src_plugins/io_pcb/parse_l.l" { return(T_NETLISTPATCH); } YY_BREAK case 32: YY_RULE_SETUP -#line 138 "../../src_plugins/io_pcb/parse_l.l" +#line 139 "../../src_plugins/io_pcb/parse_l.l" { return(T_ADD_CONN); } YY_BREAK case 33: YY_RULE_SETUP -#line 139 "../../src_plugins/io_pcb/parse_l.l" +#line 140 "../../src_plugins/io_pcb/parse_l.l" { return(T_DEL_CONN); } YY_BREAK case 34: YY_RULE_SETUP -#line 140 "../../src_plugins/io_pcb/parse_l.l" +#line 141 "../../src_plugins/io_pcb/parse_l.l" { return(T_CHANGE_ATTRIB); } YY_BREAK case 35: YY_RULE_SETUP -#line 141 "../../src_plugins/io_pcb/parse_l.l" +#line 142 "../../src_plugins/io_pcb/parse_l.l" { return(T_ATTRIBUTE); } YY_BREAK case 36: YY_RULE_SETUP -#line 143 "../../src_plugins/io_pcb/parse_l.l" +#line 144 "../../src_plugins/io_pcb/parse_l.l" { return T_NM; } YY_BREAK case 37: YY_RULE_SETUP -#line 144 "../../src_plugins/io_pcb/parse_l.l" +#line 145 "../../src_plugins/io_pcb/parse_l.l" { return T_UM; } YY_BREAK case 38: YY_RULE_SETUP -#line 145 "../../src_plugins/io_pcb/parse_l.l" +#line 146 "../../src_plugins/io_pcb/parse_l.l" { return T_MM; } YY_BREAK case 39: YY_RULE_SETUP -#line 146 "../../src_plugins/io_pcb/parse_l.l" +#line 147 "../../src_plugins/io_pcb/parse_l.l" { return T_M; } YY_BREAK case 40: YY_RULE_SETUP -#line 147 "../../src_plugins/io_pcb/parse_l.l" +#line 148 "../../src_plugins/io_pcb/parse_l.l" { return T_KM; } YY_BREAK case 41: YY_RULE_SETUP -#line 148 "../../src_plugins/io_pcb/parse_l.l" +#line 149 "../../src_plugins/io_pcb/parse_l.l" { return T_UMIL; } YY_BREAK case 42: YY_RULE_SETUP -#line 149 "../../src_plugins/io_pcb/parse_l.l" +#line 150 "../../src_plugins/io_pcb/parse_l.l" { return T_CMIL; } YY_BREAK case 43: YY_RULE_SETUP -#line 150 "../../src_plugins/io_pcb/parse_l.l" +#line 151 "../../src_plugins/io_pcb/parse_l.l" { return T_MIL; } YY_BREAK case 44: YY_RULE_SETUP -#line 151 "../../src_plugins/io_pcb/parse_l.l" +#line 152 "../../src_plugins/io_pcb/parse_l.l" { return T_IN; } YY_BREAK case 45: YY_RULE_SETUP -#line 153 "../../src_plugins/io_pcb/parse_l.l" +#line 154 "../../src_plugins/io_pcb/parse_l.l" { yylval.integer = (unsigned) *(yytext+1); return(CHAR_CONST); @@ -1223,17 +1224,17 @@ YY_BREAK case 46: YY_RULE_SETUP -#line 157 "../../src_plugins/io_pcb/parse_l.l" +#line 158 "../../src_plugins/io_pcb/parse_l.l" { return parse_number(); } YY_BREAK case 47: YY_RULE_SETUP -#line 158 "../../src_plugins/io_pcb/parse_l.l" +#line 159 "../../src_plugins/io_pcb/parse_l.l" { yylval.integer = round (strtod (yytext, NULL)); return INTEGER; } YY_BREAK case 48: YY_RULE_SETUP -#line 160 "../../src_plugins/io_pcb/parse_l.l" +#line 161 "../../src_plugins/io_pcb/parse_l.l" { unsigned n; sscanf((char *) yytext, "%x", &n); yylval.integer = n; @@ -1242,7 +1243,7 @@ YY_BREAK case 49: YY_RULE_SETUP -#line 165 "../../src_plugins/io_pcb/parse_l.l" +#line 166 "../../src_plugins/io_pcb/parse_l.l" { char *p1, *p2; @@ -1278,18 +1279,18 @@ YY_BREAK case 50: YY_RULE_SETUP -#line 197 "../../src_plugins/io_pcb/parse_l.l" +#line 198 "../../src_plugins/io_pcb/parse_l.l" {} YY_BREAK case 51: YY_RULE_SETUP -#line 198 "../../src_plugins/io_pcb/parse_l.l" +#line 199 "../../src_plugins/io_pcb/parse_l.l" {} YY_BREAK case 52: /* rule 52 can match eol */ YY_RULE_SETUP -#line 199 "../../src_plugins/io_pcb/parse_l.l" +#line 200 "../../src_plugins/io_pcb/parse_l.l" { #ifndef FLEX_SCANNER yylineno++; @@ -1298,20 +1299,20 @@ YY_BREAK case 53: YY_RULE_SETUP -#line 204 "../../src_plugins/io_pcb/parse_l.l" +#line 205 "../../src_plugins/io_pcb/parse_l.l" {} YY_BREAK case 54: YY_RULE_SETUP -#line 205 "../../src_plugins/io_pcb/parse_l.l" +#line 206 "../../src_plugins/io_pcb/parse_l.l" { return(*yytext); } YY_BREAK case 55: YY_RULE_SETUP -#line 207 "../../src_plugins/io_pcb/parse_l.l" +#line 208 "../../src_plugins/io_pcb/parse_l.l" ECHO; YY_BREAK -#line 1315 "lex.yy.c" +#line 1316 "lex.yy.c" case YY_STATE_EOF(INITIAL): yyterminate(); @@ -2321,7 +2322,7 @@ #define YYTABLES_NAME "yytables" -#line 207 "../../src_plugins/io_pcb/parse_l.l" +#line 208 "../../src_plugins/io_pcb/parse_l.l" Index: trunk/src_plugins/io_pcb/parse_l.l =================================================================== --- trunk/src_plugins/io_pcb/parse_l.l (revision 1807) +++ trunk/src_plugins/io_pcb/parse_l.l (revision 1808) @@ -43,6 +43,7 @@ #endif #include "global.h" +#include "flags.h" #ifdef HAVE_LIBDMALLOC # include /* see http://dmalloc.com */ Index: trunk/src_plugins/io_pcb/parse_y.c =================================================================== --- trunk/src_plugins/io_pcb/parse_y.c (revision 1807) +++ trunk/src_plugins/io_pcb/parse_y.c (revision 1808) @@ -110,6 +110,7 @@ #include "strflags.h" #include "thermal.h" #include "rats_patch.h" +#include "flags.h" #ifdef HAVE_LIBDMALLOC # include /* see http://dmalloc.com */ @@ -160,7 +161,7 @@ #include "parse_y.h" -#line 164 "parse_y.tab.c" /* yacc.c:339 */ +#line 165 "parse_y.tab.c" /* yacc.c:339 */ # ifndef YY_NULLPTR # if defined __cplusplus && 201103L <= __cplusplus @@ -251,7 +252,7 @@ typedef union YYSTYPE YYSTYPE; union YYSTYPE { -#line 112 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:355 */ +#line 113 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:355 */ int integer; double number; @@ -259,7 +260,7 @@ FlagType flagtype; PLMeasure measure; -#line 263 "parse_y.tab.c" /* yacc.c:355 */ +#line 264 "parse_y.tab.c" /* yacc.c:355 */ }; # define YYSTYPE_IS_TRIVIAL 1 # define YYSTYPE_IS_DECLARED 1 @@ -274,7 +275,7 @@ /* Copy the second part of user declarations. */ -#line 278 "parse_y.tab.c" /* yacc.c:358 */ +#line 279 "parse_y.tab.c" /* yacc.c:358 */ #ifdef short # undef short @@ -576,28 +577,28 @@ /* YYRLINE[YYN] -- Source line where rule number YYN was defined. */ static const yytype_uint16 yyrline[] = { - 0, 139, 139, 140, 141, 142, 166, 166, 224, 224, - 235, 235, 254, 255, 260, 260, 300, 302, 332, 338, - 344, 373, 374, 375, 378, 386, 401, 435, 441, 447, - 463, 465, 490, 492, 523, 525, 526, 527, 531, 541, - 552, 579, 583, 588, 616, 620, 664, 673, 682, 686, - 687, 691, 692, 696, 697, 697, 698, 699, 701, 701, - 708, 712, 713, 714, 715, 716, 752, 762, 773, 783, - 793, 829, 834, 866, 865, 893, 894, 898, 899, 903, - 904, 905, 906, 907, 908, 910, 915, 916, 917, 918, - 918, 919, 949, 958, 967, 1015, 1024, 1033, 1070, 1080, - 1098, 1148, 1147, 1186, 1188, 1193, 1192, 1199, 1201, 1206, - 1210, 1270, 1271, 1272, 1273, 1274, 1282, 1281, 1300, 1299, - 1318, 1317, 1338, 1336, 1360, 1358, 1439, 1440, 1444, 1445, - 1446, 1447, 1448, 1450, 1455, 1460, 1465, 1470, 1475, 1480, - 1480, 1484, 1485, 1489, 1490, 1491, 1492, 1494, 1500, 1507, - 1512, 1517, 1517, 1558, 1570, 1582, 1593, 1609, 1663, 1677, - 1690, 1701, 1712, 1713, 1717, 1718, 1740, 1742, 1758, 1777, - 1778, 1781, 1783, 1784, 1805, 1812, 1828, 1829, 1833, 1838, - 1839, 1843, 1844, 1868, 1867, 1877, 1878, 1882, 1883, 1902, - 1919, 1920, 1924, 1929, 1930, 1934, 1935, 1950, 1951, 1952, - 1979, 1987, 1988, 1992, 1993, 1998, 1999, 2000, 2001, 2002, - 2003, 2004, 2005, 2006, 2007 + 0, 140, 140, 141, 142, 143, 167, 167, 225, 225, + 236, 236, 255, 256, 261, 261, 301, 303, 333, 339, + 345, 374, 375, 376, 379, 387, 402, 436, 442, 448, + 464, 466, 491, 493, 524, 526, 527, 528, 532, 542, + 553, 580, 584, 589, 617, 621, 665, 674, 683, 687, + 688, 692, 693, 697, 698, 698, 699, 700, 702, 702, + 709, 713, 714, 715, 716, 717, 753, 763, 774, 784, + 794, 830, 835, 867, 866, 894, 895, 899, 900, 904, + 905, 906, 907, 908, 909, 911, 916, 917, 918, 919, + 919, 920, 950, 959, 968, 1016, 1025, 1034, 1071, 1081, + 1099, 1149, 1148, 1187, 1189, 1194, 1193, 1200, 1202, 1207, + 1211, 1271, 1272, 1273, 1274, 1275, 1283, 1282, 1301, 1300, + 1319, 1318, 1339, 1337, 1361, 1359, 1440, 1441, 1445, 1446, + 1447, 1448, 1449, 1451, 1456, 1461, 1466, 1471, 1476, 1481, + 1481, 1485, 1486, 1490, 1491, 1492, 1493, 1495, 1501, 1508, + 1513, 1518, 1518, 1559, 1571, 1583, 1594, 1610, 1664, 1678, + 1691, 1702, 1713, 1714, 1718, 1719, 1741, 1743, 1759, 1778, + 1779, 1782, 1784, 1785, 1806, 1813, 1829, 1830, 1834, 1839, + 1840, 1844, 1845, 1869, 1868, 1878, 1879, 1883, 1884, 1903, + 1920, 1921, 1925, 1930, 1931, 1935, 1936, 1951, 1952, 1953, + 1980, 1988, 1989, 1993, 1994, 1999, 2000, 2001, 2002, 2003, + 2004, 2005, 2006, 2007, 2008 }; #endif @@ -1774,13 +1775,13 @@ switch (yyn) { case 5: -#line 142 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ +#line 143 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ { YYABORT; } -#line 1780 "parse_y.tab.c" /* yacc.c:1646 */ +#line 1781 "parse_y.tab.c" /* yacc.c:1646 */ break; case 6: -#line 166 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ +#line 167 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ { /* reset flags for 'used layers'; * init font and data pointers @@ -1801,11 +1802,11 @@ yyPCB->NetlistPatches = yyPCB->NetlistPatchLast = NULL; layer_group_string = NULL; } -#line 1805 "parse_y.tab.c" /* yacc.c:1646 */ +#line 1806 "parse_y.tab.c" /* yacc.c:1646 */ break; case 7: -#line 200 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ +#line 201 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ { PCBTypePtr pcb_save = PCB; @@ -1829,28 +1830,28 @@ ENDALL_LOOP; PCB = pcb_save; } -#line 1833 "parse_y.tab.c" /* yacc.c:1646 */ +#line 1834 "parse_y.tab.c" /* yacc.c:1646 */ break; case 8: -#line 224 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ +#line 225 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ { PreLoadElementPCB (); layer_group_string = NULL; } -#line 1840 "parse_y.tab.c" /* yacc.c:1646 */ +#line 1841 "parse_y.tab.c" /* yacc.c:1646 */ break; case 9: -#line 227 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ +#line 228 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ { LayerFlag[0] = true; LayerFlag[1] = true; yyData->LayerN = 2; PostLoadElementPCB (); } -#line 1850 "parse_y.tab.c" /* yacc.c:1646 */ +#line 1851 "parse_y.tab.c" /* yacc.c:1646 */ break; case 10: -#line 235 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ +#line 236 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ { /* reset flags for 'used layers'; * init font and data pointers @@ -1866,11 +1867,11 @@ LayerFlag[i] = false; yyData->LayerN = 0; } -#line 1870 "parse_y.tab.c" /* yacc.c:1646 */ +#line 1871 "parse_y.tab.c" /* yacc.c:1646 */ break; case 14: -#line 260 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ +#line 261 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ { /* mark all symbols invalid */ int i; @@ -1885,20 +1886,20 @@ free (yyFont->Symbol[i].Line); bzero(yyFont->Symbol, sizeof(yyFont->Symbol)); } -#line 1889 "parse_y.tab.c" /* yacc.c:1646 */ +#line 1890 "parse_y.tab.c" /* yacc.c:1646 */ break; case 15: -#line 275 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ +#line 276 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ { yyFont->Valid = true; SetFontInfo(yyFont); } -#line 1898 "parse_y.tab.c" /* yacc.c:1646 */ +#line 1899 "parse_y.tab.c" /* yacc.c:1646 */ break; case 17: -#line 303 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ +#line 304 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ { if (check_file_version ((yyvsp[-1].integer)) != 0) { @@ -1905,51 +1906,51 @@ YYABORT; } } -#line 1909 "parse_y.tab.c" /* yacc.c:1646 */ +#line 1910 "parse_y.tab.c" /* yacc.c:1646 */ break; case 18: -#line 333 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ +#line 334 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ { yyPCB->Name = (yyvsp[-1].string); yyPCB->MaxWidth = MAX_COORD; yyPCB->MaxHeight = MAX_COORD; } -#line 1919 "parse_y.tab.c" /* yacc.c:1646 */ +#line 1920 "parse_y.tab.c" /* yacc.c:1646 */ break; case 19: -#line 339 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ +#line 340 "../../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 1929 "parse_y.tab.c" /* yacc.c:1646 */ +#line 1930 "parse_y.tab.c" /* yacc.c:1646 */ break; case 20: -#line 345 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ +#line 346 "../../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 1939 "parse_y.tab.c" /* yacc.c:1646 */ +#line 1940 "parse_y.tab.c" /* yacc.c:1646 */ break; case 24: -#line 379 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ +#line 380 "../../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 1949 "parse_y.tab.c" /* yacc.c:1646 */ +#line 1950 "parse_y.tab.c" /* yacc.c:1646 */ break; case 25: -#line 387 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ +#line 388 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ { yyPCB->Grid = OU ((yyvsp[-4].measure)); yyPCB->GridOffsetX = OU ((yyvsp[-3].measure)); @@ -1961,11 +1962,11 @@ conf_set(CFR_DESIGN, "editor/draw_grid", -1, "false", POL_OVERWRITE); } } -#line 1965 "parse_y.tab.c" /* yacc.c:1646 */ +#line 1966 "parse_y.tab.c" /* yacc.c:1646 */ break; case 26: -#line 402 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ +#line 403 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ { yyPCB->Grid = NU ((yyvsp[-4].measure)); yyPCB->GridOffsetX = NU ((yyvsp[-3].measure)); @@ -1977,48 +1978,48 @@ conf_set(CFR_DESIGN, "editor/draw_grid", -1, "false", POL_OVERWRITE); } } -#line 1981 "parse_y.tab.c" /* yacc.c:1646 */ +#line 1982 "parse_y.tab.c" /* yacc.c:1646 */ break; case 27: -#line 436 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ +#line 437 "../../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 1991 "parse_y.tab.c" /* yacc.c:1646 */ +#line 1992 "parse_y.tab.c" /* yacc.c:1646 */ break; case 28: -#line 442 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ +#line 443 "../../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 2001 "parse_y.tab.c" /* yacc.c:1646 */ +#line 2002 "parse_y.tab.c" /* yacc.c:1646 */ break; case 31: -#line 466 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ +#line 467 "../../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 2010 "parse_y.tab.c" /* yacc.c:1646 */ +#line 2011 "parse_y.tab.c" /* yacc.c:1646 */ break; case 33: -#line 493 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ +#line 494 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ { yyPCB->ThermScale = (yyvsp[-1].number); } -#line 2018 "parse_y.tab.c" /* yacc.c:1646 */ +#line 2019 "parse_y.tab.c" /* yacc.c:1646 */ break; case 38: -#line 532 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ +#line 533 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ { yyPCB->Bloat = NU ((yyvsp[-3].measure)); yyPCB->Shrink = NU ((yyvsp[-2].measure)); @@ -2025,11 +2026,11 @@ yyPCB->minWid = NU ((yyvsp[-1].measure)); yyPCB->minRing = NU ((yyvsp[-1].measure)); } -#line 2029 "parse_y.tab.c" /* yacc.c:1646 */ +#line 2030 "parse_y.tab.c" /* yacc.c:1646 */ break; case 39: -#line 542 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ +#line 543 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ { yyPCB->Bloat = NU ((yyvsp[-4].measure)); yyPCB->Shrink = NU ((yyvsp[-3].measure)); @@ -2037,11 +2038,11 @@ yyPCB->minSlk = NU ((yyvsp[-1].measure)); yyPCB->minRing = NU ((yyvsp[-2].measure)); } -#line 2041 "parse_y.tab.c" /* yacc.c:1646 */ +#line 2042 "parse_y.tab.c" /* yacc.c:1646 */ break; case 40: -#line 553 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ +#line 554 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ { yyPCB->Bloat = NU ((yyvsp[-6].measure)); yyPCB->Shrink = NU ((yyvsp[-5].measure)); @@ -2050,36 +2051,36 @@ yyPCB->minDrill = NU ((yyvsp[-2].measure)); yyPCB->minRing = NU ((yyvsp[-1].measure)); } -#line 2054 "parse_y.tab.c" /* yacc.c:1646 */ +#line 2055 "parse_y.tab.c" /* yacc.c:1646 */ break; case 41: -#line 580 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ +#line 581 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ { yyPCB->Flags = MakeFlags ((yyvsp[-1].integer) & PCB_FLAGS); } -#line 2062 "parse_y.tab.c" /* yacc.c:1646 */ +#line 2063 "parse_y.tab.c" /* yacc.c:1646 */ break; case 42: -#line 584 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ +#line 585 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ { yyPCB->Flags = string_to_pcbflags ((yyvsp[-1].string), yyerror); free((yyvsp[-1].string)); } -#line 2071 "parse_y.tab.c" /* yacc.c:1646 */ +#line 2072 "parse_y.tab.c" /* yacc.c:1646 */ break; case 44: -#line 617 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ +#line 618 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ { layer_group_string = (yyvsp[-1].string); } -#line 2079 "parse_y.tab.c" /* yacc.c:1646 */ +#line 2080 "parse_y.tab.c" /* yacc.c:1646 */ break; case 46: -#line 665 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ +#line 666 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ { if (ParseRouteString((yyvsp[-1].string), &yyPCB->RouteStyle[0], "mil")) { @@ -2088,11 +2089,11 @@ } free((yyvsp[-1].string)); } -#line 2092 "parse_y.tab.c" /* yacc.c:1646 */ +#line 2093 "parse_y.tab.c" /* yacc.c:1646 */ break; case 47: -#line 674 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ +#line 675 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ { if (ParseRouteString((yyvsp[-1].string), &yyPCB->RouteStyle[0], "cmil")) { @@ -2101,17 +2102,17 @@ } free((yyvsp[-1].string)); } -#line 2105 "parse_y.tab.c" /* yacc.c:1646 */ +#line 2106 "parse_y.tab.c" /* yacc.c:1646 */ break; case 54: -#line 697 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ +#line 698 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ { attr_list = & yyPCB->Attributes; } -#line 2111 "parse_y.tab.c" /* yacc.c:1646 */ +#line 2112 "parse_y.tab.c" /* yacc.c:1646 */ break; case 58: -#line 701 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ +#line 702 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ { /* clear pointer to force memory allocation by * the appropriate subroutine @@ -2118,57 +2119,57 @@ */ yyElement = NULL; } -#line 2122 "parse_y.tab.c" /* yacc.c:1646 */ +#line 2123 "parse_y.tab.c" /* yacc.c:1646 */ break; case 60: -#line 708 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ +#line 709 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ { YYABORT; } -#line 2128 "parse_y.tab.c" /* yacc.c:1646 */ +#line 2129 "parse_y.tab.c" /* yacc.c:1646 */ break; case 66: -#line 753 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ +#line 754 "../../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 2138 "parse_y.tab.c" /* yacc.c:1646 */ +#line 2139 "parse_y.tab.c" /* yacc.c:1646 */ break; case 67: -#line 763 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ +#line 764 "../../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 2148 "parse_y.tab.c" /* yacc.c:1646 */ +#line 2149 "parse_y.tab.c" /* yacc.c:1646 */ break; case 68: -#line 774 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ +#line 775 "../../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 2158 "parse_y.tab.c" /* yacc.c:1646 */ +#line 2159 "parse_y.tab.c" /* yacc.c:1646 */ break; case 69: -#line 784 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ +#line 785 "../../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 2168 "parse_y.tab.c" /* yacc.c:1646 */ +#line 2169 "parse_y.tab.c" /* yacc.c:1646 */ break; case 70: -#line 794 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ +#line 795 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ { Coord hole = (OU((yyvsp[-3].measure)) * DEFAULT_DRILLINGHOLE); @@ -2181,29 +2182,29 @@ OU((yyvsp[-3].measure)) + 2*MASKFRAME, hole, (yyvsp[-2].string), OldFlags((yyvsp[-1].integer))); free ((yyvsp[-2].string)); } -#line 2185 "parse_y.tab.c" /* yacc.c:1646 */ +#line 2186 "parse_y.tab.c" /* yacc.c:1646 */ break; case 71: -#line 830 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ +#line 831 "../../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 2194 "parse_y.tab.c" /* yacc.c:1646 */ +#line 2195 "parse_y.tab.c" /* yacc.c:1646 */ break; case 72: -#line 835 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ +#line 836 "../../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 2203 "parse_y.tab.c" /* yacc.c:1646 */ +#line 2204 "parse_y.tab.c" /* yacc.c:1646 */ break; case 73: -#line 866 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ +#line 867 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ { if ((yyvsp[-4].integer) <= 0 || (yyvsp[-4].integer) > MAX_LAYER + 2) { @@ -2227,44 +2228,44 @@ if ((yyvsp[-2].string) != NULL) free((yyvsp[-2].string)); } -#line 2231 "parse_y.tab.c" /* yacc.c:1646 */ +#line 2232 "parse_y.tab.c" /* yacc.c:1646 */ break; case 85: -#line 911 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ +#line 912 "../../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 2240 "parse_y.tab.c" /* yacc.c:1646 */ +#line 2241 "parse_y.tab.c" /* yacc.c:1646 */ break; case 89: -#line 918 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ +#line 919 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ { attr_list = & Layer->Attributes; } -#line 2246 "parse_y.tab.c" /* yacc.c:1646 */ +#line 2247 "parse_y.tab.c" /* yacc.c:1646 */ break; case 92: -#line 950 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ +#line 951 "../../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 2255 "parse_y.tab.c" /* yacc.c:1646 */ +#line 2256 "parse_y.tab.c" /* yacc.c:1646 */ break; case 93: -#line 959 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ +#line 960 "../../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 2264 "parse_y.tab.c" /* yacc.c:1646 */ +#line 2265 "parse_y.tab.c" /* yacc.c:1646 */ break; case 94: -#line 968 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ +#line 969 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ { /* eliminate old-style rat-lines */ if ((IV ((yyvsp[-1].measure)) & RATFLAG) == 0) @@ -2271,48 +2272,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 2275 "parse_y.tab.c" /* yacc.c:1646 */ +#line 2276 "parse_y.tab.c" /* yacc.c:1646 */ break; case 95: -#line 1016 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ +#line 1017 "../../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 2284 "parse_y.tab.c" /* yacc.c:1646 */ +#line 2285 "parse_y.tab.c" /* yacc.c:1646 */ break; case 96: -#line 1025 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ +#line 1026 "../../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 2293 "parse_y.tab.c" /* yacc.c:1646 */ +#line 2294 "parse_y.tab.c" /* yacc.c:1646 */ break; case 97: -#line 1034 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ +#line 1035 "../../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 2302 "parse_y.tab.c" /* yacc.c:1646 */ +#line 2303 "parse_y.tab.c" /* yacc.c:1646 */ break; case 98: -#line 1071 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ +#line 1072 "../../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 2312 "parse_y.tab.c" /* yacc.c:1646 */ +#line 2313 "parse_y.tab.c" /* yacc.c:1646 */ break; case 99: -#line 1081 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ +#line 1082 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ { if ((yyvsp[-1].integer) & ONSILKFLAG) { @@ -2327,11 +2328,11 @@ OldFlags((yyvsp[-1].integer))); free ((yyvsp[-2].string)); } -#line 2331 "parse_y.tab.c" /* yacc.c:1646 */ +#line 2332 "parse_y.tab.c" /* yacc.c:1646 */ break; case 100: -#line 1099 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ +#line 1100 "../../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 @@ -2351,19 +2352,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 2355 "parse_y.tab.c" /* yacc.c:1646 */ +#line 2356 "parse_y.tab.c" /* yacc.c:1646 */ break; case 101: -#line 1148 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ +#line 1149 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ { Polygon = CreateNewPolygon(Layer, (yyvsp[-2].flagtype)); } -#line 2363 "parse_y.tab.c" /* yacc.c:1646 */ +#line 2364 "parse_y.tab.c" /* yacc.c:1646 */ break; case 102: -#line 1153 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ +#line 1154 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ { Cardinal contour, contour_start, contour_end; bool bad_contour_found = false; @@ -2395,35 +2396,35 @@ r_insert_entry (Layer->polygon_tree, (BoxType *) Polygon, 0); } } -#line 2399 "parse_y.tab.c" /* yacc.c:1646 */ +#line 2400 "parse_y.tab.c" /* yacc.c:1646 */ break; case 105: -#line 1193 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ +#line 1194 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ { CreateNewHoleInPolygon (Polygon); } -#line 2407 "parse_y.tab.c" /* yacc.c:1646 */ +#line 2408 "parse_y.tab.c" /* yacc.c:1646 */ break; case 109: -#line 1207 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ +#line 1208 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ { CreateNewPointInPolygon(Polygon, OU ((yyvsp[-2].measure)), OU ((yyvsp[-1].measure))); } -#line 2415 "parse_y.tab.c" /* yacc.c:1646 */ +#line 2416 "parse_y.tab.c" /* yacc.c:1646 */ break; case 110: -#line 1211 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ +#line 1212 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ { CreateNewPointInPolygon(Polygon, NU ((yyvsp[-2].measure)), NU ((yyvsp[-1].measure))); } -#line 2423 "parse_y.tab.c" /* yacc.c:1646 */ +#line 2424 "parse_y.tab.c" /* yacc.c:1646 */ break; case 116: -#line 1282 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ +#line 1283 "../../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); @@ -2431,19 +2432,19 @@ free ((yyvsp[-5].string)); pin_num = 1; } -#line 2435 "parse_y.tab.c" /* yacc.c:1646 */ +#line 2436 "parse_y.tab.c" /* yacc.c:1646 */ break; case 117: -#line 1290 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ +#line 1291 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ { SetElementBoundingBox(yyData, yyElement, yyFont); } -#line 2443 "parse_y.tab.c" /* yacc.c:1646 */ +#line 2444 "parse_y.tab.c" /* yacc.c:1646 */ break; case 118: -#line 1300 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ +#line 1301 "../../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); @@ -2451,19 +2452,19 @@ free ((yyvsp[-7].string)); pin_num = 1; } -#line 2455 "parse_y.tab.c" /* yacc.c:1646 */ +#line 2456 "parse_y.tab.c" /* yacc.c:1646 */ break; case 119: -#line 1308 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ +#line 1309 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ { SetElementBoundingBox(yyData, yyElement, yyFont); } -#line 2463 "parse_y.tab.c" /* yacc.c:1646 */ +#line 2464 "parse_y.tab.c" /* yacc.c:1646 */ break; case 120: -#line 1318 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ +#line 1319 "../../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); @@ -2472,19 +2473,19 @@ free ((yyvsp[-7].string)); pin_num = 1; } -#line 2476 "parse_y.tab.c" /* yacc.c:1646 */ +#line 2477 "parse_y.tab.c" /* yacc.c:1646 */ break; case 121: -#line 1327 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ +#line 1328 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ { SetElementBoundingBox(yyData, yyElement, yyFont); } -#line 2484 "parse_y.tab.c" /* yacc.c:1646 */ +#line 2485 "parse_y.tab.c" /* yacc.c:1646 */ break; case 122: -#line 1338 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ +#line 1339 "../../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)), @@ -2495,19 +2496,19 @@ free ((yyvsp[-10].string)); free ((yyvsp[-9].string)); } -#line 2499 "parse_y.tab.c" /* yacc.c:1646 */ +#line 2500 "parse_y.tab.c" /* yacc.c:1646 */ break; case 123: -#line 1349 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ +#line 1350 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ { SetElementBoundingBox(yyData, yyElement, yyFont); } -#line 2507 "parse_y.tab.c" /* yacc.c:1646 */ +#line 2508 "parse_y.tab.c" /* yacc.c:1646 */ break; case 124: -#line 1360 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ +#line 1361 "../../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)), @@ -2518,119 +2519,119 @@ free ((yyvsp[-10].string)); free ((yyvsp[-9].string)); } -#line 2522 "parse_y.tab.c" /* yacc.c:1646 */ +#line 2523 "parse_y.tab.c" /* yacc.c:1646 */ break; case 125: -#line 1371 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ +#line 1372 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ { SetElementBoundingBox(yyData, yyElement, yyFont); } -#line 2530 "parse_y.tab.c" /* yacc.c:1646 */ +#line 2531 "parse_y.tab.c" /* yacc.c:1646 */ break; case 133: -#line 1451 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ +#line 1452 "../../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 2538 "parse_y.tab.c" /* yacc.c:1646 */ +#line 2539 "parse_y.tab.c" /* yacc.c:1646 */ break; case 134: -#line 1456 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ +#line 1457 "../../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 2546 "parse_y.tab.c" /* yacc.c:1646 */ +#line 2547 "parse_y.tab.c" /* yacc.c:1646 */ break; case 135: -#line 1461 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ +#line 1462 "../../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 2554 "parse_y.tab.c" /* yacc.c:1646 */ +#line 2555 "parse_y.tab.c" /* yacc.c:1646 */ break; case 136: -#line 1466 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ +#line 1467 "../../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 2562 "parse_y.tab.c" /* yacc.c:1646 */ +#line 2563 "parse_y.tab.c" /* yacc.c:1646 */ break; case 137: -#line 1471 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ +#line 1472 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ { yyElement->MarkX = NU ((yyvsp[-2].measure)); yyElement->MarkY = NU ((yyvsp[-1].measure)); } -#line 2571 "parse_y.tab.c" /* yacc.c:1646 */ +#line 2572 "parse_y.tab.c" /* yacc.c:1646 */ break; case 138: -#line 1476 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ +#line 1477 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ { yyElement->MarkX = OU ((yyvsp[-2].measure)); yyElement->MarkY = OU ((yyvsp[-1].measure)); } -#line 2580 "parse_y.tab.c" /* yacc.c:1646 */ +#line 2581 "parse_y.tab.c" /* yacc.c:1646 */ break; case 139: -#line 1480 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ +#line 1481 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ { attr_list = & yyElement->Attributes; } -#line 2586 "parse_y.tab.c" /* yacc.c:1646 */ +#line 2587 "parse_y.tab.c" /* yacc.c:1646 */ break; case 147: -#line 1495 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ +#line 1496 "../../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 2596 "parse_y.tab.c" /* yacc.c:1646 */ +#line 2597 "parse_y.tab.c" /* yacc.c:1646 */ break; case 148: -#line 1501 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ +#line 1502 "../../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 2606 "parse_y.tab.c" /* yacc.c:1646 */ +#line 2607 "parse_y.tab.c" /* yacc.c:1646 */ break; case 149: -#line 1508 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ +#line 1509 "../../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 2615 "parse_y.tab.c" /* yacc.c:1646 */ +#line 2616 "parse_y.tab.c" /* yacc.c:1646 */ break; case 150: -#line 1513 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ +#line 1514 "../../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 2624 "parse_y.tab.c" /* yacc.c:1646 */ +#line 2625 "parse_y.tab.c" /* yacc.c:1646 */ break; case 151: -#line 1517 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ +#line 1518 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ { attr_list = & yyElement->Attributes; } -#line 2630 "parse_y.tab.c" /* yacc.c:1646 */ +#line 2631 "parse_y.tab.c" /* yacc.c:1646 */ break; case 153: -#line 1559 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ +#line 1560 "../../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), @@ -2638,11 +2639,11 @@ free ((yyvsp[-3].string)); free ((yyvsp[-2].string)); } -#line 2642 "parse_y.tab.c" /* yacc.c:1646 */ +#line 2643 "parse_y.tab.c" /* yacc.c:1646 */ break; case 154: -#line 1571 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ +#line 1572 "../../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), @@ -2650,11 +2651,11 @@ free ((yyvsp[-3].string)); free ((yyvsp[-2].string)); } -#line 2654 "parse_y.tab.c" /* yacc.c:1646 */ +#line 2655 "parse_y.tab.c" /* yacc.c:1646 */ break; case 155: -#line 1583 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ +#line 1584 "../../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))); @@ -2661,11 +2662,11 @@ free ((yyvsp[-3].string)); free ((yyvsp[-2].string)); } -#line 2665 "parse_y.tab.c" /* yacc.c:1646 */ +#line 2666 "parse_y.tab.c" /* yacc.c:1646 */ break; case 156: -#line 1594 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ +#line 1595 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ { char p_number[8]; @@ -2675,11 +2676,11 @@ free ((yyvsp[-2].string)); } -#line 2679 "parse_y.tab.c" /* yacc.c:1646 */ +#line 2680 "parse_y.tab.c" /* yacc.c:1646 */ break; case 157: -#line 1610 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ +#line 1611 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ { Coord hole = OU ((yyvsp[-3].measure)) * DEFAULT_DRILLINGHOLE; char p_number[8]; @@ -2694,11 +2695,11 @@ OU ((yyvsp[-3].measure)) + 2*MASKFRAME, hole, (yyvsp[-2].string), p_number, OldFlags((yyvsp[-1].integer))); free ((yyvsp[-2].string)); } -#line 2698 "parse_y.tab.c" /* yacc.c:1646 */ +#line 2699 "parse_y.tab.c" /* yacc.c:1646 */ break; case 158: -#line 1664 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ +#line 1665 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ { CreateNewPad(yyElement, NU ((yyvsp[-10].measure)) + yyElement->MarkX, NU ((yyvsp[-9].measure)) + yyElement->MarkY, @@ -2708,11 +2709,11 @@ free ((yyvsp[-3].string)); free ((yyvsp[-2].string)); } -#line 2712 "parse_y.tab.c" /* yacc.c:1646 */ +#line 2713 "parse_y.tab.c" /* yacc.c:1646 */ break; case 159: -#line 1678 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ +#line 1679 "../../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, @@ -2721,11 +2722,11 @@ free ((yyvsp[-3].string)); free ((yyvsp[-2].string)); } -#line 2725 "parse_y.tab.c" /* yacc.c:1646 */ +#line 2726 "parse_y.tab.c" /* yacc.c:1646 */ break; case 160: -#line 1691 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ +#line 1692 "../../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))); @@ -2732,11 +2733,11 @@ free ((yyvsp[-3].string)); free ((yyvsp[-2].string)); } -#line 2736 "parse_y.tab.c" /* yacc.c:1646 */ +#line 2737 "parse_y.tab.c" /* yacc.c:1646 */ break; case 161: -#line 1702 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ +#line 1703 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ { char p_number[8]; @@ -2745,23 +2746,23 @@ OU ((yyvsp[-3].measure)) + 2*MASKFRAME, (yyvsp[-2].string),p_number, OldFlags((yyvsp[-1].integer))); free ((yyvsp[-2].string)); } -#line 2749 "parse_y.tab.c" /* yacc.c:1646 */ +#line 2750 "parse_y.tab.c" /* yacc.c:1646 */ break; case 162: -#line 1712 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ +#line 1713 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ { (yyval.flagtype) = OldFlags((yyvsp[0].integer)); } -#line 2755 "parse_y.tab.c" /* yacc.c:1646 */ +#line 2756 "parse_y.tab.c" /* yacc.c:1646 */ break; case 163: -#line 1713 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ +#line 1714 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ { (yyval.flagtype) = string_to_flags ((yyvsp[0].string), yyerror); free((yyvsp[0].string)); } -#line 2761 "parse_y.tab.c" /* yacc.c:1646 */ +#line 2762 "parse_y.tab.c" /* yacc.c:1646 */ break; case 167: -#line 1743 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ +#line 1744 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ { if ((yyvsp[-3].integer) <= 0 || (yyvsp[-3].integer) > MAX_FONTPOSITION) { @@ -2777,11 +2778,11 @@ Symbol->Valid = true; Symbol->Delta = NU ((yyvsp[-2].measure)); } -#line 2781 "parse_y.tab.c" /* yacc.c:1646 */ +#line 2782 "parse_y.tab.c" /* yacc.c:1646 */ break; case 168: -#line 1759 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ +#line 1760 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ { if ((yyvsp[-3].integer) <= 0 || (yyvsp[-3].integer) > MAX_FONTPOSITION) { @@ -2797,158 +2798,158 @@ Symbol->Valid = true; Symbol->Delta = OU ((yyvsp[-2].measure)); } -#line 2801 "parse_y.tab.c" /* yacc.c:1646 */ +#line 2802 "parse_y.tab.c" /* yacc.c:1646 */ break; case 174: -#line 1806 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ +#line 1807 "../../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 2809 "parse_y.tab.c" /* yacc.c:1646 */ +#line 2810 "parse_y.tab.c" /* yacc.c:1646 */ break; case 175: -#line 1813 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ +#line 1814 "../../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 2817 "parse_y.tab.c" /* yacc.c:1646 */ +#line 2818 "parse_y.tab.c" /* yacc.c:1646 */ break; case 183: -#line 1868 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ +#line 1869 "../../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 2827 "parse_y.tab.c" /* yacc.c:1646 */ +#line 2828 "parse_y.tab.c" /* yacc.c:1646 */ break; case 189: -#line 1903 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ +#line 1904 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ { CreateNewConnection(Menu, (yyvsp[-1].string)); free ((yyvsp[-1].string)); } -#line 2836 "parse_y.tab.c" /* yacc.c:1646 */ +#line 2837 "parse_y.tab.c" /* yacc.c:1646 */ break; case 197: -#line 1950 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ +#line 1951 "../../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 2842 "parse_y.tab.c" /* yacc.c:1646 */ +#line 2843 "parse_y.tab.c" /* yacc.c:1646 */ break; case 198: -#line 1951 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ +#line 1952 "../../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 2848 "parse_y.tab.c" /* yacc.c:1646 */ +#line 2849 "parse_y.tab.c" /* yacc.c:1646 */ break; case 199: -#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_CHANGE_ATTRIB, (yyvsp[-3].string), (yyvsp[-2].string), (yyvsp[-1].string)); free((yyvsp[-3].string)); free((yyvsp[-2].string)); free((yyvsp[-1].string)); } -#line 2854 "parse_y.tab.c" /* yacc.c:1646 */ +#line 2855 "parse_y.tab.c" /* yacc.c:1646 */ break; case 200: -#line 1980 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ +#line 1981 "../../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 2864 "parse_y.tab.c" /* yacc.c:1646 */ +#line 2865 "parse_y.tab.c" /* yacc.c:1646 */ break; case 201: -#line 1987 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ +#line 1988 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ { (yyval.string) = (yyvsp[0].string); } -#line 2870 "parse_y.tab.c" /* yacc.c:1646 */ +#line 2871 "parse_y.tab.c" /* yacc.c:1646 */ break; case 202: -#line 1988 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ +#line 1989 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ { (yyval.string) = 0; } -#line 2876 "parse_y.tab.c" /* yacc.c:1646 */ +#line 2877 "parse_y.tab.c" /* yacc.c:1646 */ break; case 203: -#line 1992 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ +#line 1993 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ { (yyval.number) = (yyvsp[0].number); } -#line 2882 "parse_y.tab.c" /* yacc.c:1646 */ +#line 2883 "parse_y.tab.c" /* yacc.c:1646 */ break; case 204: -#line 1993 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ +#line 1994 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ { (yyval.number) = (yyvsp[0].integer); } -#line 2888 "parse_y.tab.c" /* yacc.c:1646 */ +#line 2889 "parse_y.tab.c" /* yacc.c:1646 */ break; case 205: -#line 1998 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ +#line 1999 "../../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 2894 "parse_y.tab.c" /* yacc.c:1646 */ +#line 2895 "parse_y.tab.c" /* yacc.c:1646 */ break; case 206: -#line 1999 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ +#line 2000 "../../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 2900 "parse_y.tab.c" /* yacc.c:1646 */ +#line 2901 "parse_y.tab.c" /* yacc.c:1646 */ break; case 207: -#line 2000 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ +#line 2001 "../../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 2906 "parse_y.tab.c" /* yacc.c:1646 */ +#line 2907 "parse_y.tab.c" /* yacc.c:1646 */ break; case 208: -#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))); } -#line 2912 "parse_y.tab.c" /* yacc.c:1646 */ +#line 2913 "parse_y.tab.c" /* yacc.c:1646 */ break; case 209: -#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), INCH_TO_COORD ((yyvsp[-1].number))); } -#line 2918 "parse_y.tab.c" /* yacc.c:1646 */ +#line 2919 "parse_y.tab.c" /* yacc.c:1646 */ break; case 210: -#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), MM_TO_COORD ((yyvsp[-1].number)) / 1000000.0); } -#line 2924 "parse_y.tab.c" /* yacc.c:1646 */ +#line 2925 "parse_y.tab.c" /* yacc.c:1646 */ break; case 211: -#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), MM_TO_COORD ((yyvsp[-1].number)) / 1000.0); } -#line 2930 "parse_y.tab.c" /* yacc.c:1646 */ +#line 2931 "parse_y.tab.c" /* yacc.c:1646 */ break; case 212: -#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))); } -#line 2936 "parse_y.tab.c" /* yacc.c:1646 */ +#line 2937 "parse_y.tab.c" /* yacc.c:1646 */ break; case 213: -#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 2942 "parse_y.tab.c" /* yacc.c:1646 */ +#line 2943 "parse_y.tab.c" /* yacc.c:1646 */ break; case 214: -#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)) * 1000000.0); } -#line 2948 "parse_y.tab.c" /* yacc.c:1646 */ +#line 2949 "parse_y.tab.c" /* yacc.c:1646 */ break; -#line 2952 "parse_y.tab.c" /* yacc.c:1646 */ +#line 2953 "parse_y.tab.c" /* yacc.c:1646 */ default: break; } /* User semantic actions sometimes alter yychar, and that requires @@ -3176,7 +3177,7 @@ #endif return yyresult; } -#line 2010 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1906 */ +#line 2011 "../../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 1807) +++ trunk/src_plugins/io_pcb/parse_y.h (revision 1808) @@ -101,7 +101,7 @@ typedef union YYSTYPE YYSTYPE; union YYSTYPE { -#line 112 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1909 */ +#line 113 "../../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 1807) +++ trunk/src_plugins/io_pcb/parse_y.y (revision 1808) @@ -55,6 +55,7 @@ #include "strflags.h" #include "thermal.h" #include "rats_patch.h" +#include "flags.h" #ifdef HAVE_LIBDMALLOC # include /* see http://dmalloc.com */ Index: trunk/src_plugins/renumber/renumber.c =================================================================== --- trunk/src_plugins/renumber/renumber.c (revision 1807) +++ trunk/src_plugins/renumber/renumber.c (revision 1808) @@ -35,6 +35,7 @@ #include "set.h" #include "plugins.h" #include "hid_actions.h" +#include "conf_core.h" #include "pcb-printf.h" @@ -71,7 +72,7 @@ } *cnt_list; char **was, **is, *pin; unsigned int c_cnt = 0, numele; - int unique, ok; + int ok; int free_name = 0; if (argc < 1) { @@ -191,8 +192,8 @@ * in our way. When we're done with the renumber we will have unique * names. */ - unique = TEST_FLAG(UNIQUENAMEFLAG, PCB); - CLEAR_FLAG(UNIQUENAMEFLAG, PCB); + /* It is OK to directly write conf_core here, it's a temp change and will be restored at the end */ + conf_core.editor.unique_names = 0; cnt_list = (struct _cnt_list *) calloc(cnt_list_sz, sizeof(struct _cnt_list)); for (i = 0; i < cnt; i++) { @@ -296,8 +297,7 @@ fclose(out); /* restore the unique flag setting */ - if (unique) - SET_FLAG(UNIQUENAMEFLAG, PCB); + conf_update(); if (changed) { Index: trunk/src_plugins/report/report.c =================================================================== --- trunk/src_plugins/report/report.c (revision 1807) +++ trunk/src_plugins/report/report.c (revision 1808) @@ -417,7 +417,7 @@ TextTypePtr text; #ifndef NDEBUG if (gui->shift_is_pressed()) { - __r_dump_tree(PCB->Data->name_tree[NAME_INDEX(PCB)]->root, 0); + __r_dump_tree(PCB->Data->name_tree[NAME_INDEX()]->root, 0); return 0; } #endif