Index: trunk/src/attrib.c =================================================================== --- trunk/src/attrib.c (revision 11019) +++ trunk/src/attrib.c (revision 11020) @@ -161,3 +161,15 @@ pcb_attribute_remove_idx(dst, i); } + +void pcb_attrib_compat_set_intconn(pcb_attribute_list_t *dst, int intconn) +{ + char buff[32]; + + if (intconn <= 0) + return; + + sprintf(buff, "%d", intconn & 0xFF); + pcb_attribute_put(dst, "intconn", buff); +} + Index: trunk/src/attrib.h =================================================================== --- trunk/src/attrib.h (revision 11019) +++ trunk/src/attrib.h (revision 11020) @@ -74,4 +74,7 @@ void pcb_attribute_copyback(pcb_attribute_list_t *dst, const char *name, const char *value); void pcb_attribute_copyback_end(pcb_attribute_list_t *dst); +/* Set the intconn attribute - hack for compatibility parsing */ +void pcb_attrib_compat_set_intconn(pcb_attribute_list_t *dst, int intconn); + #endif Index: trunk/src/obj_pad.c =================================================================== --- trunk/src/obj_pad.c (revision 11019) +++ trunk/src/obj_pad.c (revision 11020) @@ -53,6 +53,7 @@ new_obj = calloc(sizeof(pcb_pad_t), 1); new_obj->type = PCB_OBJ_PAD; + new_obj->Attributes.post_change = pcb_obj_attrib_post_change; PCB_SET_PARENT(new_obj, element, element); padlist_append(&element->Pad, new_obj); Index: trunk/src/obj_pinvia.c =================================================================== --- trunk/src/obj_pinvia.c (revision 11019) +++ trunk/src/obj_pinvia.c (revision 11020) @@ -76,6 +76,7 @@ new_obj = calloc(sizeof(pcb_pin_t), 1); new_obj->type = PCB_OBJ_PIN; + new_obj->Attributes.post_change = pcb_obj_attrib_post_change; PCB_SET_PARENT(new_obj, element, element); pinlist_append(&element->Pin, new_obj); Index: trunk/src_plugins/io_lihata/read.c =================================================================== --- trunk/src_plugins/io_lihata/read.c (revision 11019) +++ trunk/src_plugins/io_lihata/read.c (revision 11020) @@ -368,6 +368,7 @@ static int parse_line(pcb_layer_t *ly, pcb_element_t *el, lht_node_t *obj, int no_id, pcb_coord_t dx, pcb_coord_t dy) { pcb_line_t *line; + unsigned char intconn = 0; if (ly != NULL) line = pcb_line_alloc(ly); @@ -380,7 +381,8 @@ line->ID = 0; else parse_id(&line->ID, obj, 5); - parse_flags(&line->Flags, lht_dom_hash_get(obj, "flags"), PCB_TYPE_LINE, &line->intconn); + parse_flags(&line->Flags, lht_dom_hash_get(obj, "flags"), PCB_TYPE_LINE, &intconn); + pcb_attrib_compat_set_intconn(&line->Attributes, intconn); parse_attributes(&line->Attributes, lht_dom_hash_get(obj, "attributes")); parse_coord(&line->Thickness, lht_dom_hash_get(obj, "thickness")); @@ -411,7 +413,7 @@ pcb_rat_t rat, *new_rat; parse_id(&rat.ID, obj, 4); - parse_flags(&rat.Flags, lht_dom_hash_get(obj, "flags"), PCB_TYPE_LINE, &rat.intconn); + parse_flags(&rat.Flags, lht_dom_hash_get(obj, "flags"), PCB_TYPE_LINE, NULL); parse_attributes(&rat.Attributes, lht_dom_hash_get(obj, "attributes")); parse_coord(&rat.Point1.X, lht_dom_hash_get(obj, "x1")); @@ -436,6 +438,7 @@ static int parse_arc(pcb_layer_t *ly, pcb_element_t *el, lht_node_t *obj, pcb_coord_t dx, pcb_coord_t dy) { pcb_arc_t *arc; + unsigned char intconn = 0; if (ly != NULL) arc = pcb_arc_alloc(ly); @@ -445,7 +448,8 @@ return -1; parse_id(&arc->ID, obj, 4); - parse_flags(&arc->Flags, lht_dom_hash_get(obj, "flags"), PCB_TYPE_ARC, &arc->intconn); + parse_flags(&arc->Flags, lht_dom_hash_get(obj, "flags"), PCB_TYPE_ARC, &intconn); + pcb_attrib_compat_set_intconn(&arc->Attributes, intconn); parse_attributes(&arc->Attributes, lht_dom_hash_get(obj, "attributes")); parse_coord(&arc->Thickness, lht_dom_hash_get(obj, "thickness")); @@ -472,9 +476,11 @@ pcb_polygon_t *poly = pcb_poly_alloc(ly); lht_node_t *geo; pcb_cardinal_t n = 0, c; + unsigned char intconn = 0; parse_id(&poly->ID, obj, 8); - parse_flags(&poly->Flags, lht_dom_hash_get(obj, "flags"), PCB_TYPE_POLYGON, &poly->intconn); + parse_flags(&poly->Flags, lht_dom_hash_get(obj, "flags"), PCB_TYPE_POLYGON, &intconn); + pcb_attrib_compat_set_intconn(&poly->Attributes, intconn); parse_attributes(&poly->Attributes, lht_dom_hash_get(obj, "attributes")); geo = lht_dom_hash_get(obj, "geometry"); @@ -524,6 +530,7 @@ pcb_text_t *text; lht_node_t *role; int tmp; + unsigned char intconn = 0; role = lht_dom_hash_get(obj, "role"); @@ -544,7 +551,8 @@ parse_id(&text->ID, obj, 5); - parse_flags(&text->Flags, lht_dom_hash_get(obj, "flags"), PCB_TYPE_TEXT, &text->intconn); + parse_flags(&text->Flags, lht_dom_hash_get(obj, "flags"), PCB_TYPE_TEXT, &intconn); + pcb_attrib_compat_set_intconn(&text->Attributes, intconn); parse_attributes(&text->Attributes, lht_dom_hash_get(obj, "attributes")); parse_int(&text->Scale, lht_dom_hash_get(obj, "scale")); parse_int(&tmp, lht_dom_hash_get(obj, "fid")); @@ -673,6 +681,7 @@ static int parse_pin(pcb_data_t *dt, pcb_element_t *el, lht_node_t *obj, pcb_coord_t dx, pcb_coord_t dy) { pcb_pin_t *via; + unsigned char intconn = 0; if (dt != NULL) via = pcb_via_alloc(dt); @@ -682,7 +691,8 @@ return -1; parse_id(&via->ID, obj, 4); - parse_flags(&via->Flags, lht_dom_hash_get(obj, "flags"), PCB_TYPE_VIA, &via->intconn); + parse_flags(&via->Flags, lht_dom_hash_get(obj, "flags"), PCB_TYPE_VIA, &intconn); + pcb_attrib_compat_set_intconn(&via->Attributes, intconn); parse_attributes(&via->Attributes, lht_dom_hash_get(obj, "attributes")); parse_coord(&via->Thickness, lht_dom_hash_get(obj, "thickness")); @@ -708,11 +718,13 @@ static int parse_pad(pcb_element_t *el, lht_node_t *obj, pcb_coord_t dx, pcb_coord_t dy) { pcb_pad_t *pad; + unsigned char intconn = 0; pad = pcb_pad_alloc(el); parse_id(&pad->ID, obj, 4); - parse_flags(&pad->Flags, lht_dom_hash_get(obj, "flags"), PCB_TYPE_PAD, &pad->intconn); + parse_flags(&pad->Flags, lht_dom_hash_get(obj, "flags"), PCB_TYPE_PAD, &intconn); + pcb_attrib_compat_set_intconn(&pad->Attributes, intconn); parse_attributes(&pad->Attributes, lht_dom_hash_get(obj, "attributes")); parse_coord(&pad->Thickness, lht_dom_hash_get(obj, "thickness")); @@ -787,9 +799,11 @@ static int parse_subc(pcb_board_t *pcb, pcb_data_t *dt, lht_node_t *obj) { pcb_subc_t *sc = pcb_subc_alloc(dt); + unsigned char intconn = 0; parse_id(&sc->ID, obj, 5); - parse_flags(&sc->Flags, lht_dom_hash_get(obj, "flags"), PCB_TYPE_ELEMENT, &sc->intconn); + parse_flags(&sc->Flags, lht_dom_hash_get(obj, "flags"), PCB_TYPE_ELEMENT, &intconn); + pcb_attrib_compat_set_intconn(&sc->Attributes, intconn); parse_attributes(&sc->Attributes, lht_dom_hash_get(obj, "attributes")); parse_minuid(sc->uid, lht_dom_hash_get(obj, "uid")); Index: trunk/src_plugins/io_lihata/write.c =================================================================== --- trunk/src_plugins/io_lihata/write.c (revision 11019) +++ trunk/src_plugins/io_lihata/write.c (revision 11020) @@ -160,8 +160,11 @@ return dummy_node("attributes"); ln = lht_dom_node_alloc(LHT_HASH, "attributes"); - for (n = 0; n < lst->Number; n++) + for (n = 0; n < lst->Number; n++) { + if ((wrver < 3) && (strcmp(lst->List[n].name, "intconn") == 0)) + continue; /* do not write intconn as attribute for v1 and v2, we used a flag for those */ lht_dom_hash_put(ln, build_text(lst->List[n].name, lst->List[n].value)); + } return ln; } Index: trunk/src_plugins/io_pcb/parse_y.c =================================================================== --- trunk/src_plugins/io_pcb/parse_y.c (revision 11019) +++ trunk/src_plugins/io_pcb/parse_y.c (revision 11020) @@ -2662,7 +2662,7 @@ pcb_pin_t *pin = pcb_element_pin_new(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), (yyvsp[-2].string), (yyvsp[-1].flagtype)); - pin->intconn = yy_intconn; + pcb_attrib_compat_set_intconn(&pin->Attributes, yy_intconn); free ((yyvsp[-3].string)); free ((yyvsp[-2].string)); } @@ -2733,7 +2733,7 @@ NU ((yyvsp[-8].measure)) + yyElement->MarkX, NU ((yyvsp[-7].measure)) + yyElement->MarkY, NU ((yyvsp[-6].measure)), NU ((yyvsp[-5].measure)), NU ((yyvsp[-4].measure)), (yyvsp[-3].string), (yyvsp[-2].string), (yyvsp[-1].flagtype)); - pad->intconn = yy_intconn; + pcb_attrib_compat_set_intconn(&pad->Attributes, yy_intconn); free ((yyvsp[-3].string)); free ((yyvsp[-2].string)); } Index: trunk/src_plugins/io_pcb/parse_y.y =================================================================== --- trunk/src_plugins/io_pcb/parse_y.y (revision 11019) +++ trunk/src_plugins/io_pcb/parse_y.y (revision 11020) @@ -1581,7 +1581,7 @@ pcb_pin_t *pin = pcb_element_pin_new(yyElement, NU ($3) + yyElement->MarkX, NU ($4) + yyElement->MarkY, NU ($5), NU ($6), NU ($7), NU ($8), $9, $10, $11); - pin->intconn = yy_intconn; + pcb_attrib_compat_set_intconn(&pin->Attributes, yy_intconn); free ($9); free ($10); } @@ -1689,7 +1689,7 @@ NU ($5) + yyElement->MarkX, NU ($6) + yyElement->MarkY, NU ($7), NU ($8), NU ($9), $10, $11, $12); - pad->intconn = yy_intconn; + pcb_attrib_compat_set_intconn(&pad->Attributes, yy_intconn); free ($10); free ($11); }