Index: read.c =================================================================== --- read.c (revision 30902) +++ read.c (revision 30903) @@ -83,19 +83,19 @@ #define if_save_uniq(node, name) \ if (pcb_strcasecmp(node->str, #name) == 0) { \ if (n ## name != NULL) { \ - pcb_message(PCB_MSG_ERROR, "Multiple " #name " nodes where only one is expected (at %ld:%ld)\n", (long)node->line, (long)node->col); \ + rnd_message(PCB_MSG_ERROR, "Multiple " #name " nodes where only one is expected (at %ld:%ld)\n", (long)node->line, (long)node->col); \ return -1; \ } \ n ## name = node; \ } -static pcb_coord_t COORD(dsn_read_t *ctx, gsxl_node_t *n) +static rnd_coord_t COORD(dsn_read_t *ctx, gsxl_node_t *n) { char *end, *s = STRE(n); double v = strtod(s, &end); if (*end != '\0') { - pcb_message(PCB_MSG_ERROR, "Invalid coord: '%s' (at %ld:%ld)\n", s, (long)n->line, (long)n->col); + rnd_message(PCB_MSG_ERROR, "Invalid coord: '%s' (at %ld:%ld)\n", s, (long)n->line, (long)n->col); return 0; } v /= ctx->unit->scale_factor; @@ -108,7 +108,7 @@ #define COORDY(ctx, n) (ctx->bbox.Y2 - COORD(ctx, n)) /* load coordinates from nodes starting from src, hoppin on ->next, into - pcb_coord_t dst[]. Each coord is converted according to the next char + rnd_coord_t dst[]. Each coord is converted according to the next char in const char *fmt[]; 'c' is raw coord, 'x' and 'y' are board coords, 'X' and 'Y' are relative coords */ #define DSN_LOAD_COORDS_FMT(dst, src, fmt, err_statement) \ @@ -142,7 +142,7 @@ ctx->unit = get_unit_struct(su); if (ctx->unit == NULL) { - pcb_message(PCB_MSG_ERROR, "Invalid unit: '%s' (at %ld:%ld)\n", su, (long)nu->line, (long)nu->col); + rnd_message(PCB_MSG_ERROR, "Invalid unit: '%s' (at %ld:%ld)\n", su, (long)nu->line, (long)nu->col); return NULL; } @@ -175,9 +175,9 @@ static int dsn_parse_wire(dsn_read_t *ctx, gsxl_node_t *wrr, pcb_subc_t *subc, pcb_layer_t *force_ly); -static pcb_coord_t dsn_load_aper(dsn_read_t *ctx, gsxl_node_t *c) +static rnd_coord_t dsn_load_aper(dsn_read_t *ctx, gsxl_node_t *c) { - pcb_coord_t res = COORD(ctx, c); + rnd_coord_t res = COORD(ctx, c); if (res == 0) res = 1; return res; @@ -191,10 +191,10 @@ static int dsn_parse_rect(dsn_read_t *ctx, pcb_box_t *dst, gsxl_node_t *src, int no_y_flip) { - pcb_coord_t x, y; + rnd_coord_t x, y; if (src == NULL) { - pcb_message(PCB_MSG_ERROR, "Missing coord in rect\n"); + rnd_message(PCB_MSG_ERROR, "Missing coord in rect\n"); return -1; } @@ -221,7 +221,7 @@ return 0; err:; - pcb_message(PCB_MSG_ERROR, "Missing coord in rect (at %ld:%ld)\n", (long)src->line, (long)src->col); + rnd_message(PCB_MSG_ERROR, "Missing coord in rect (at %ld:%ld)\n", (long)src->line, (long)src->col); return -1; } @@ -236,7 +236,7 @@ return 0; } -static void boundary_line(pcb_layer_t *oly, pcb_coord_t x1, pcb_coord_t y1, pcb_coord_t x2, pcb_coord_t y2, pcb_coord_t aper) +static void boundary_line(pcb_layer_t *oly, rnd_coord_t x1, rnd_coord_t y1, rnd_coord_t x2, rnd_coord_t y2, rnd_coord_t aper) { if (aper <= 0) aper = 1; @@ -250,16 +250,16 @@ if (bnd->str == NULL) continue; if (pcb_strcasecmp(bnd->str, "path") == 0) { - pcb_coord_t x, y, lx, ly, fx, fy, aper; + rnd_coord_t x, y, lx, ly, fx, fy, aper; int len; b = gsxl_children(bnd); if (!do_bbox && (pcb_strcasecmp(STRE(b), "pcb") == 0)) { - pcb_message(PCB_MSG_ERROR, "PCB boundary shall be a rect, not a path;\naccepting the path, but other software may choke on this file\n"); + rnd_message(PCB_MSG_ERROR, "PCB boundary shall be a rect, not a path;\naccepting the path, but other software may choke on this file\n"); ctx->has_pcb_boundary = 1; } if ((b->next == NULL) || (b->next->next == NULL)) { - pcb_message(PCB_MSG_ERROR, "not enough arguments for boundary poly (at %ld:%ld)\n", (long)b->line, (long)b->col); + rnd_message(PCB_MSG_ERROR, "not enough arguments for boundary poly (at %ld:%ld)\n", (long)b->line, (long)b->col); return -1; } @@ -268,7 +268,7 @@ for(len = 0, n = b->next->next; n != NULL; len++) { x = COORDX(ctx, n); if (n->next == NULL) { - pcb_message(PCB_MSG_ERROR, "Not enough coordinate values (missing y)\n"); + rnd_message(PCB_MSG_ERROR, "Not enough coordinate values (missing y)\n"); break; } n = n->next; @@ -298,7 +298,7 @@ b = gsxl_children(bnd); if ((b->next == NULL) || (b->next->next == NULL)) { - pcb_message(PCB_MSG_ERROR, "not enough arguments for boundary rect (at %ld:%ld)\n", (long)b->line, (long)b->col); + rnd_message(PCB_MSG_ERROR, "not enough arguments for boundary rect (at %ld:%ld)\n", (long)b->line, (long)b->col); return -1; } if (pcb_strcasecmp(STRE(b), "pcb") == 0) @@ -328,7 +328,7 @@ return 0; if (pcb_layer_list(ctx->pcb, PCB_LYT_BOUNDARY, &olid, 1) < 1) { - pcb_message(PCB_MSG_ERROR, "Intenal error: no boundary layer found\n"); + rnd_message(PCB_MSG_ERROR, "Intenal error: no boundary layer found\n"); return -1; } oly = pcb_get_layer(ctx->pcb->Data, olid); @@ -352,7 +352,7 @@ return 0; } - pcb_message(PCB_MSG_WARNING, "Ignoring unknown layer type '%s' for %s\n", ty, grp->name); + rnd_message(PCB_MSG_WARNING, "Ignoring unknown layer type '%s' for %s\n", ty, grp->name); return 0; } @@ -359,7 +359,7 @@ #define CHECK_TOO_MANY_LAYERS(node, num) \ do { \ if (num >= PCB_MAX_LAYERGRP) { \ - pcb_message(PCB_MSG_ERROR, "Too many layer groups in the layer stack (at %ld:%ld)\n", (long)node->line, (long)node->col); \ + rnd_message(PCB_MSG_ERROR, "Too many layer groups in the layer stack (at %ld:%ld)\n", (long)node->line, (long)node->col); \ return -1; \ } \ } while(0) @@ -386,7 +386,7 @@ }; if (str == NULL) { - pcb_message(PCB_MSG_ERROR, "Can not parse board without a structure subtree\n"); + rnd_message(PCB_MSG_ERROR, "Can not parse board without a structure subtree\n"); return -1; } @@ -416,7 +416,7 @@ ly = pcb_get_layer(ctx->pcb->Data, botcop->lid[0]); if (ly == NULL) { - pcb_message(PCB_MSG_ERROR, "io_dsn internal error: no layer in group\n"); + rnd_message(PCB_MSG_ERROR, "io_dsn internal error: no layer in group\n"); return -1; } htsp_set(&ctx->name2layer, (char *)ly->name, ly); @@ -436,7 +436,7 @@ } if (topcop == NULL) { - pcb_message(PCB_MSG_ERROR, "Can not parse board without a copper layers\n"); + rnd_message(PCB_MSG_ERROR, "Can not parse board without a copper layers\n"); return -1; } @@ -484,7 +484,7 @@ } if ((ctx->bbox.X1 < 0) || (ctx->bbox.Y1 < 0)) - pcb_message(PCB_MSG_WARNING, "Negative coordinates on input - you may want to execute autocrop()\n"); + rnd_message(PCB_MSG_WARNING, "Negative coordinates on input - you may want to execute autocrop()\n"); ctx->pcb->hidlib.size_x = ctx->bbox.X2 - ctx->bbox.X1; ctx->pcb->hidlib.size_y = ctx->bbox.Y2 - ctx->bbox.Y1; @@ -491,7 +491,7 @@ if (!ctx->has_pcb_boundary) { ctx->bbox.X1 = ctx->bbox.Y1 = ctx->bbox.X2 = ctx->bbox.Y2 = 0; - pcb_message(PCB_MSG_ERROR, "Missing pcb boundary; every dsn design must have a pcb boundary.\ntrying to make up one using the bounding box.\nYou may want to execute autocrop()\n"); + rnd_message(PCB_MSG_ERROR, "Missing pcb boundary; every dsn design must have a pcb boundary.\ntrying to make up one using the bounding box.\nYou may want to execute autocrop()\n"); } /* place polygons on planes */ @@ -499,7 +499,7 @@ if (pcb_attribute_get(&grp->Attributes, "plane") != NULL) { pcb_layer_t *ly; if (!ctx->has_pcb_boundary) { - pcb_message(PCB_MSG_ERROR, "Because of the missing pcb boundary power planes are not filled with polygons.\n"); + rnd_message(PCB_MSG_ERROR, "Because of the missing pcb boundary power planes are not filled with polygons.\n"); return 0; } ly = pcb_get_layer(ctx->pcb->Data, grp->lid[0]); @@ -518,7 +518,7 @@ gsxl_node_t *args = nd->children->next; if ((args == NULL) || (args->str == NULL)) { - pcb_message(PCB_MSG_ERROR, "Padstack circle: not enough arguments (at %ld:%ld)\n", (long)nd->line, (long)nd->col); + rnd_message(PCB_MSG_ERROR, "Padstack circle: not enough arguments (at %ld:%ld)\n", (long)nd->line, (long)nd->col); return -1; } @@ -566,13 +566,13 @@ gsxl_node_t *th = nd->children->next, *args = th->next; if ((args == NULL) || (args->next == NULL) || (args->next->next == NULL) || (args->next->next->next == NULL)) { - pcb_message(PCB_MSG_ERROR, "Padstack path: not enough arguments (at %ld:%ld)\n", (long)nd->line, (long)nd->col); + rnd_message(PCB_MSG_ERROR, "Padstack path: not enough arguments (at %ld:%ld)\n", (long)nd->line, (long)nd->col); return -1; } extra = args->next->next->next->next; if ((extra != NULL) && (!isalpha(*extra->str))) { - pcb_message(PCB_MSG_ERROR, "Padstack path: too many arguments - only a single line supported (at %ld:%ld)\n", (long)nd->line, (long)nd->col); + rnd_message(PCB_MSG_ERROR, "Padstack path: too many arguments - only a single line supported (at %ld:%ld)\n", (long)nd->line, (long)nd->col); return -1; } @@ -592,18 +592,18 @@ int dsn_parse_pstk_shape_poly(dsn_read_t *ctx, gsxl_node_t *nd, pcb_pstk_shape_t *shp) { gsxl_node_t *n, *ap = nd->children->next, *args = ap->next; - pcb_coord_t aper; + rnd_coord_t aper; long len, i; for(len = 0, n = args; (n != NULL) && !(isalpha(*n->str)); n = n->next, len++) ; if (len < 3) { - pcb_message(PCB_MSG_ERROR, "Padstack poly: too few points (at %ld:%ld)\n", (long)nd->line, (long)nd->col); + rnd_message(PCB_MSG_ERROR, "Padstack poly: too few points (at %ld:%ld)\n", (long)nd->line, (long)nd->col); return -1; } if ((len % 2) != 0) { - pcb_message(PCB_MSG_ERROR, "Padstack poly: wrong (odd) number of arguments (at %ld:%ld)\n", (long)nd->line, (long)nd->col); + rnd_message(PCB_MSG_ERROR, "Padstack poly: wrong (odd) number of arguments (at %ld:%ld)\n", (long)nd->line, (long)nd->col); return -1; } @@ -639,7 +639,7 @@ { memset(shp, 0, sizeof(pcb_pstk_shape_t)); if ((sn == NULL) || (sn->str == NULL)) { - pcb_message(PCB_MSG_ERROR, "Invalid padstack shape (at %ld:%ld)\n", (long)sn->line, (long)sn->col); + rnd_message(PCB_MSG_ERROR, "Invalid padstack shape (at %ld:%ld)\n", (long)sn->line, (long)sn->col); return -1; } if (pcb_strcasecmp(sn->str, "circle") == 0) { @@ -659,11 +659,11 @@ return -1; } else if (pcb_strcasecmp(sn->str, "qarc") == 0) { - pcb_message(PCB_MSG_ERROR, "Unsupported padstack shape %s (at %ld:%ld)\n", sn->str, (long)sn->line, (long)sn->col); + rnd_message(PCB_MSG_ERROR, "Unsupported padstack shape %s (at %ld:%ld)\n", sn->str, (long)sn->line, (long)sn->col); return -1; } else { - pcb_message(PCB_MSG_ERROR, "Invalid/unknown padstack shape %s (at %ld:%ld)\n", sn->str, (long)sn->line, (long)sn->col); + rnd_message(PCB_MSG_ERROR, "Invalid/unknown padstack shape %s (at %ld:%ld)\n", sn->str, (long)sn->line, (long)sn->col); return -1; } return 0; @@ -681,7 +681,7 @@ ly = htsp_get(&ctx->name2layer, nname); \ if (ly == NULL) { - pcb_message(PCB_MSG_ERROR, "Invalid/unknown net '%s' (at %ld:%ld)\n", nname, (long)net->line, (long)net->col); + rnd_message(PCB_MSG_ERROR, "Invalid/unknown net '%s' (at %ld:%ld)\n", nname, (long)net->line, (long)net->col); return -1; } @@ -712,7 +712,7 @@ if (pcb_pstk_shape_eq(existing, shp)) return; - pcb_message(PCB_MSG_WARNING, "Incompatible padstack: some shape details are lost (at %ld:%ld)\n", (long)nd->line, (long)nd->col); + rnd_message(PCB_MSG_WARNING, "Incompatible padstack: some shape details are lost (at %ld:%ld)\n", (long)nd->line, (long)nd->col); } static void dsn_pstk_set_shape(pcb_pstk_proto_t *prt, pcb_layer_type_t lyt, pcb_pstk_shape_t *shp, gsxl_node_t *nd) @@ -736,7 +736,7 @@ int has_hole = 0; if ((wrr->children == NULL) || (wrr->children->str == NULL)) { - pcb_message(PCB_MSG_WARNING, "Empty padstack (at %ld:%ld)\n", (long)wrr->line, (long)wrr->col); + rnd_message(PCB_MSG_WARNING, "Empty padstack (at %ld:%ld)\n", (long)wrr->line, (long)wrr->col); return -1; } @@ -771,7 +771,7 @@ goto err; if (!pcb_pstk_shape_eq(&hole, &shp)) - pcb_message(PCB_MSG_WARNING, "Incompatible padstack: non-uniform hole geometry; keeping one hole shape randomly (at %ld:%ld)\n", (long)n->line, (long)n->col); + rnd_message(PCB_MSG_WARNING, "Incompatible padstack: non-uniform hole geometry; keeping one hole shape randomly (at %ld:%ld)\n", (long)n->line, (long)n->col); pcb_pstk_shape_free(&shp); } @@ -790,7 +790,7 @@ } else if ((pcb_strcasecmp(n->str, "rotate") == 0) || (pcb_strcasecmp(n->str, "absolute") == 0)) { if (pcb_strcasecmp(STRE(n->children), "off") == 0) { - pcb_message(PCB_MSG_WARNING, "unhandled padstack flag %s (at %ld:%ld) - this property will be ignored\n", n->str, (long)n->line, (long)n->col); + rnd_message(PCB_MSG_WARNING, "unhandled padstack flag %s (at %ld:%ld) - this property will be ignored\n", n->str, (long)n->line, (long)n->col); } } } @@ -831,18 +831,18 @@ pcb_pstk_proto_t *proto; if ((psname == NULL) || (*psname == '\0')) { - pcb_message(PCB_MSG_ERROR, "Invalid anonymous via (at %ld:%ld)\n", (long)pn->line, (long)pn->col); + rnd_message(PCB_MSG_ERROR, "Invalid anonymous via (at %ld:%ld)\n", (long)pn->line, (long)pn->col); return -1; } proto = htsp_get(&ctx->protos, psname); if (proto == NULL) { - pcb_message(PCB_MSG_ERROR, "Unknown via '%s' (at %ld:%ld)\n", psname, (long)pn->line, (long)pn->col); + rnd_message(PCB_MSG_ERROR, "Unknown via '%s' (at %ld:%ld)\n", psname, (long)pn->line, (long)pn->col); return -1; } for(ncoord = pn->children->next; ncoord != NULL; ncoord = ncoord->next->next) { - pcb_coord_t crd[2]; + rnd_coord_t crd[2]; pcb_cardinal_t pid; DSN_LOAD_COORDS_FMT(crd, ncoord, "XY", goto err_coord); @@ -852,7 +852,7 @@ return 0; err_coord:; - pcb_message(PCB_MSG_ERROR, "Invalid via coordinates (at %ld:%ld)\n", (long)pn->line, (long)pn->col); + rnd_message(PCB_MSG_ERROR, "Invalid via coordinates (at %ld:%ld)\n", (long)pn->line, (long)pn->col); return -1; } @@ -863,22 +863,22 @@ pcb_pstk_proto_t *proto; pcb_pstk_t *ps; pcb_cardinal_t pid; - pcb_coord_t crd[2] = {0, 0}; + rnd_coord_t crd[2] = {0, 0}; double rotang = 0.0; if ((psname == NULL) || (*psname == '\0')) { - pcb_message(PCB_MSG_ERROR, "Invalid anonymous pin (at %ld:%ld)\n", (long)pn->line, (long)pn->col); + rnd_message(PCB_MSG_ERROR, "Invalid anonymous pin (at %ld:%ld)\n", (long)pn->line, (long)pn->col); return -1; } proto = htsp_get(&ctx->protos, psname); if (proto == NULL) { - pcb_message(PCB_MSG_ERROR, "Unknown pin '%s' (at %ld:%ld)\n", psname, (long)pn->line, (long)pn->col); + rnd_message(PCB_MSG_ERROR, "Unknown pin '%s' (at %ld:%ld)\n", psname, (long)pn->line, (long)pn->col); return -1; } if (pn->children->next == NULL) { - pcb_message(PCB_MSG_ERROR, "Missing pin terminal ID (at %ld:%ld)\n", (long)pn->line, (long)pn->col); + rnd_message(PCB_MSG_ERROR, "Missing pin terminal ID (at %ld:%ld)\n", (long)pn->line, (long)pn->col); return -1; } @@ -891,7 +891,7 @@ char *end; rotang = strtod(STRE(nrot->children), &end); if (*end != '\0') { - pcb_message(PCB_MSG_ERROR, "Invalid pin rotation angle (at %ld:%ld)\n", (long)pn->line, (long)pn->col); + rnd_message(PCB_MSG_ERROR, "Invalid pin rotation angle (at %ld:%ld)\n", (long)pn->line, (long)pn->col); return -1; } } @@ -906,11 +906,11 @@ pcb_attribute_put(&ps->Attributes, "term", term); } else - pcb_message(PCB_MSG_ERROR, "Failed to create via - expect missing vias (at %ld:%ld)\n", (long)pn->line, (long)pn->col); + rnd_message(PCB_MSG_ERROR, "Failed to create via - expect missing vias (at %ld:%ld)\n", (long)pn->line, (long)pn->col); return 0; err_coord:; - pcb_message(PCB_MSG_ERROR, "Invalid pin coordinates (at %ld:%ld)\n", (long)pn->line, (long)pn->col); + rnd_message(PCB_MSG_ERROR, "Invalid pin coordinates (at %ld:%ld)\n", (long)pn->line, (long)pn->col); return -1; } @@ -930,7 +930,7 @@ } } if (!found) { - pcb_message(PCB_MSG_ERROR, "Internal error: subc doc outline layer (at %ld:%ld)\n", (long)nd->line, (long)nd->col); + rnd_message(PCB_MSG_ERROR, "Internal error: subc doc outline layer (at %ld:%ld)\n", (long)nd->line, (long)nd->col); return -1; } return dsn_parse_wire(ctx, nd, subc, ly); @@ -962,7 +962,7 @@ id = STRE(imr->children); if ((id == NULL) || (*id == '\0')) { - pcb_message(PCB_MSG_WARNING, "invalid empty image name (at %ld:%ld) - this property will be ignored\n", (long)imr->line, (long)imr->col); + rnd_message(PCB_MSG_WARNING, "invalid empty image name (at %ld:%ld) - this property will be ignored\n", (long)imr->line, (long)imr->col); return -1; } @@ -1069,7 +1069,7 @@ return -1; } else if ((pcb_strcasecmp(n->str, "jumper") == 0) || (pcb_strcasecmp(n->str, "via_array_template") == 0) || (pcb_strcasecmp(n->str, "directory") == 0)) { - pcb_message(PCB_MSG_WARNING, "unhandled library item %s (at %ld:%ld) - please send the dsn file as a bugreport\n", n->str, (long)n->line, (long)n->col); + rnd_message(PCB_MSG_WARNING, "unhandled library item %s (at %ld:%ld) - please send the dsn file as a bugreport\n", n->str, (long)n->line, (long)n->col); } } @@ -1097,7 +1097,7 @@ else \ ly = htsp_get(&ctx->name2layer, __nname__); \ if (ly == NULL) { \ - pcb_message(PCB_MSG_ERROR, "Invalid/unknown net '%s' (at %ld:%ld)\n", __nname__, (long)__net__->line, (long)__net__->col); \ + rnd_message(PCB_MSG_ERROR, "Invalid/unknown net '%s' (at %ld:%ld)\n", __nname__, (long)__net__->line, (long)__net__->col); \ { fail; } \ } \ } \ @@ -1109,8 +1109,8 @@ { gsxl_node_t *n, *net = wrr->children; pcb_layer_t *ly; - pcb_coord_t aper; - pcb_coord_t x, y, fx, fy; + rnd_coord_t aper; + rnd_coord_t x, y, fx, fy; long len = 0; pcb_poly_t *poly; @@ -1117,7 +1117,7 @@ DSN_PARSE_NET(ly, net, return -1, subc, force_ly); if ((net->next == NULL) || (net->next->next == NULL)) { - pcb_message(PCB_MSG_ERROR, "Not enough wire polygon attributes (at %ld:%ld)\n", (long)wrr->line, (long)wrr->col); + rnd_message(PCB_MSG_ERROR, "Not enough wire polygon attributes (at %ld:%ld)\n", (long)wrr->line, (long)wrr->col); return -1; } @@ -1128,7 +1128,7 @@ break; x = COORDX(ctx, n); if (n->next == NULL) { - pcb_message(PCB_MSG_ERROR, "Not enough coordinate values (missing y)\n"); + rnd_message(PCB_MSG_ERROR, "Not enough coordinate values (missing y)\n"); break; } n = n->next; @@ -1152,7 +1152,7 @@ } if (len < 3) { - pcb_message(PCB_MSG_ERROR, "Not enough coordinate pairs for a polygon (at %ld:%ld)\n", (long)wrr->line, (long)wrr->col); + rnd_message(PCB_MSG_ERROR, "Not enough coordinate pairs for a polygon (at %ld:%ld)\n", (long)wrr->line, (long)wrr->col); return -1; } @@ -1209,7 +1209,7 @@ { gsxl_node_t *n, *net = wrr->children; pcb_layer_t *ly; - pcb_coord_t r, cent[2] = {0, 0}; + rnd_coord_t r, cent[2] = {0, 0}; pcb_poly_t *poly; double a, astep; @@ -1216,7 +1216,7 @@ DSN_PARSE_NET(ly, net, return -1, subc, force_ly); if ((net->next == NULL) || (net->next->next == NULL)) { - pcb_message(PCB_MSG_ERROR, "Not enough wire circle attributes (at %ld:%ld)\n", (long)wrr->line, (long)wrr->col); + rnd_message(PCB_MSG_ERROR, "Not enough wire circle attributes (at %ld:%ld)\n", (long)wrr->line, (long)wrr->col); return -1; } @@ -1230,7 +1230,7 @@ astep = 2*M_PI / (8 + r / PCB_MM_TO_COORD(0.1)); for(a = 0; a < 2*M_PI; a += astep) { - pcb_coord_t x, y; + rnd_coord_t x, y; x = pcb_round(cos(a) * (double)r + (double)cent[0]); y = pcb_round(sin(a) * (double)r + (double)cent[1]); pcb_poly_point_new(poly, x, y); @@ -1239,7 +1239,7 @@ return 0; err_cent:; - pcb_message(PCB_MSG_ERROR, "Not enough circle center attributes (at %ld:%ld)\n", (long)wrr->line, (long)wrr->col); + rnd_message(PCB_MSG_ERROR, "Not enough circle center attributes (at %ld:%ld)\n", (long)wrr->line, (long)wrr->col); return -1; } @@ -1247,14 +1247,14 @@ { gsxl_node_t *n, *net = wrr->children; pcb_layer_t *ly; - pcb_coord_t aper; - pcb_coord_t x, y, px, py; + rnd_coord_t aper; + rnd_coord_t x, y, px, py; int len = 0; DSN_PARSE_NET(ly, net, return -1, subc, force_ly); if ((net->next == NULL) || (net->next->next == NULL)) { - pcb_message(PCB_MSG_ERROR, "Not enough wire path attributes (at %ld:%ld)\n", (long)wrr->line, (long)wrr->col); + rnd_message(PCB_MSG_ERROR, "Not enough wire path attributes (at %ld:%ld)\n", (long)wrr->line, (long)wrr->col); return -1; } @@ -1263,7 +1263,7 @@ for(n = net->next->next; n != NULL;) { x = COORDX(ctx, n); if (n->next == NULL) { - pcb_message(PCB_MSG_ERROR, "Not enough coordinate values (missing y)\n"); + rnd_message(PCB_MSG_ERROR, "Not enough coordinate values (missing y)\n"); break; } n = n->next; @@ -1284,10 +1284,10 @@ return 0; } -static int qarc_angle(pcb_coord_t cx, pcb_coord_t cy, pcb_coord_t x, pcb_coord_t y, pcb_coord_t *r) +static int qarc_angle(rnd_coord_t cx, rnd_coord_t cy, rnd_coord_t x, rnd_coord_t y, rnd_coord_t *r) { - pcb_coord_t dx = x - cx; - pcb_coord_t dy = y - cy; + rnd_coord_t dx = x - cx; + rnd_coord_t dy = y - cy; if ((dx != 0) && (dy != 0)) return -1; @@ -1317,8 +1317,8 @@ { gsxl_node_t *coords, *net = wrr->children; pcb_layer_t *ly; - pcb_coord_t r1, r2, aper; - pcb_coord_t crd[6]; /* sx, sy, ex, ey, cx, cy */ + rnd_coord_t r1, r2, aper; + rnd_coord_t crd[6]; /* sx, sy, ex, ey, cx, cy */ int sa, ea; DSN_PARSE_NET(ly, net, return -1, subc, force_ly); @@ -1325,7 +1325,7 @@ if ((net->next == NULL) || ((coords = net->next->next) == NULL)) { not_enough:; - pcb_message(PCB_MSG_ERROR, "Not enough wire qarc attributes (at %ld:%ld)\n", (long)wrr->line, (long)wrr->col); + rnd_message(PCB_MSG_ERROR, "Not enough wire qarc attributes (at %ld:%ld)\n", (long)wrr->line, (long)wrr->col); return -1; } @@ -1336,7 +1336,7 @@ sa = qarc_angle(crd[4], crd[5], crd[0], crd[1], &r1); ea = qarc_angle(crd[4], crd[5], crd[2], crd[3], &r2); if ((sa == -1) || (ea == -1) || (r1 != r2)) { - pcb_message(PCB_MSG_ERROR, "invalid qarcs coords (at %ld:%ld)\n", (long)wrr->line, (long)wrr->col); + rnd_message(PCB_MSG_ERROR, "invalid qarcs coords (at %ld:%ld)\n", (long)wrr->line, (long)wrr->col); return -1; } @@ -1395,10 +1395,10 @@ pcb_pstk_proto_t *proto; const char *pname; pcb_cardinal_t pid; - pcb_coord_t crd[2] = {0, 0}; + rnd_coord_t crd[2] = {0, 0}; if ((vnd->children == NULL) || (vnd->children->str == NULL)) { - pcb_message(PCB_MSG_ERROR, "Not enough via arguments (at %ld:%ld)\n", (long)vnd->line, (long)vnd->col); + rnd_message(PCB_MSG_ERROR, "Not enough via arguments (at %ld:%ld)\n", (long)vnd->line, (long)vnd->col); return -1; } @@ -1405,7 +1405,7 @@ pname = vnd->children->str; proto = htsp_get(&ctx->protos, pname); if (proto == NULL) { - pcb_message(PCB_MSG_ERROR, "Unknown via '%s' (at %ld:%ld)\n", pname, (long)vnd->line, (long)vnd->col); + rnd_message(PCB_MSG_ERROR, "Unknown via '%s' (at %ld:%ld)\n", pname, (long)vnd->line, (long)vnd->col); return -1; } @@ -1413,17 +1413,17 @@ pid = pcb_pstk_proto_insert_dup(ctx->pcb->Data, proto, 1, 0); if (pcb_pstk_new(ctx->pcb->Data, -1, pid, crd[0], crd[1], conf_core.design.clearance/2, pcb_flag_make(PCB_FLAG_CLEARLINE)) == NULL) - pcb_message(PCB_MSG_ERROR, "Failed to create via - expect missing vias (at %ld:%ld)\n", (long)vnd->line, (long)vnd->col); + rnd_message(PCB_MSG_ERROR, "Failed to create via - expect missing vias (at %ld:%ld)\n", (long)vnd->line, (long)vnd->col); return 0; err_coord:; - pcb_message(PCB_MSG_ERROR, "Invalid via coordinates (at %ld:%ld)\n", (long)vnd->line, (long)vnd->col); + rnd_message(PCB_MSG_ERROR, "Invalid via coordinates (at %ld:%ld)\n", (long)vnd->line, (long)vnd->col); return -1; } static int dsn_parse_point(dsn_read_t *ctx, gsxl_node_t *tnd) { - pcb_coord_t crd[2] = {0, 0}; + rnd_coord_t crd[2] = {0, 0}; gsxl_node_t *side; pcb_pstk_t *ps; int back; @@ -1432,7 +1432,7 @@ side = tnd->children->next->next; if ((side == NULL) || (side->str == NULL)) { - pcb_message(PCB_MSG_ERROR, "Testpoint without side (at %ld:%ld)\n", (long)tnd->line, (long)tnd->col); + rnd_message(PCB_MSG_ERROR, "Testpoint without side (at %ld:%ld)\n", (long)tnd->line, (long)tnd->col); return -1; } if (pcb_strcasecmp(side->str, "front") == 0) { @@ -1442,7 +1442,7 @@ back = 1; } else { - pcb_message(PCB_MSG_ERROR, "Invalid testpoint side '%s' (at %ld:%ld)\n", side->str, (long)tnd->line, (long)tnd->col); + rnd_message(PCB_MSG_ERROR, "Invalid testpoint side '%s' (at %ld:%ld)\n", side->str, (long)tnd->line, (long)tnd->col); return -1; } @@ -1476,7 +1476,7 @@ ps = pcb_pstk_new(ctx->pcb->Data, -1, ctx->testpoint, crd[0], crd[1], 0, pcb_no_flags()); if (ps == NULL) { - pcb_message(PCB_MSG_ERROR, "Failed to create testpoint (at %ld:%ld)\n", (long)tnd->line, (long)tnd->col); + rnd_message(PCB_MSG_ERROR, "Failed to create testpoint (at %ld:%ld)\n", (long)tnd->line, (long)tnd->col); return 0; } @@ -1486,7 +1486,7 @@ return 0; not_enough:; - pcb_message(PCB_MSG_ERROR, "Not enough coordinates for a testpoint (at %ld:%ld)\n", (long)tnd->line, (long)tnd->col); + rnd_message(PCB_MSG_ERROR, "Not enough coordinates for a testpoint (at %ld:%ld)\n", (long)tnd->line, (long)tnd->col); return -1; } @@ -1512,7 +1512,7 @@ return -1; } else if ((pcb_strcasecmp(wrr->str, "bond") == 0) || (pcb_strcasecmp(wrr->str, "supply_pin") == 0)) { - pcb_message(PCB_MSG_WARNING, "unhandled wiring: '%s' (at %ld:%ld) - please send the dsn file as a bugreport\n", wrr->str, (long)wrr->line, (long)wrr->col); + rnd_message(PCB_MSG_WARNING, "unhandled wiring: '%s' (at %ld:%ld) - please send the dsn file as a bugreport\n", wrr->str, (long)wrr->line, (long)wrr->col); } } @@ -1530,12 +1530,12 @@ subc = htsp_get(&ctx->subcs, id); if (subc == NULL) { - pcb_message(PCB_MSG_ERROR, "Invalid image name '%s' in placement (at %ld:%ld) - please send the dsn file as a bugreport\n", id, (long)plr->line, (long)plr->col); + rnd_message(PCB_MSG_ERROR, "Invalid image name '%s' in placement (at %ld:%ld) - please send the dsn file as a bugreport\n", id, (long)plr->line, (long)plr->col); return -1; } for(n = plr->children->next; n != NULL; n = n->next) { - pcb_coord_t crd[2] = {0, 0}; + rnd_coord_t crd[2] = {0, 0}; const char *refdes = STRE(n->children); gsxl_node_t *side; int need_mirror; @@ -1546,7 +1546,7 @@ side = n->children->next->next->next; if ((side == NULL) || (side->str == NULL)) { - pcb_message(PCB_MSG_ERROR, "Invalid placement side (at %ld:%ld)\n", (long)n->line, (long)n->col); + rnd_message(PCB_MSG_ERROR, "Invalid placement side (at %ld:%ld)\n", (long)n->line, (long)n->col); return -1; } if (pcb_strcasecmp(side->str, "front") == 0) @@ -1554,13 +1554,13 @@ else if (pcb_strcasecmp(side->str, "back") == 0) need_mirror = 1; else { - pcb_message(PCB_MSG_ERROR, "Invalid placement side '%s' (at %ld:%ld)\n", side->str, (long)n->line, (long)n->col); + rnd_message(PCB_MSG_ERROR, "Invalid placement side '%s' (at %ld:%ld)\n", side->str, (long)n->line, (long)n->col); return -1; } rot = strtod(STRE(side->next), &end); if (*end != '\0') { - pcb_message(PCB_MSG_ERROR, "Invalid placement rotation '%s' - must be a number (at %ld:%ld)\n", side->next->str, (long)n->line, (long)n->col); + rnd_message(PCB_MSG_ERROR, "Invalid placement rotation '%s' - must be a number (at %ld:%ld)\n", side->next->str, (long)n->line, (long)n->col); return -1; } @@ -1583,7 +1583,7 @@ return 0; bad_coord:; - pcb_message(PCB_MSG_ERROR, "Invalid placement coords (at %ld:%ld) - please send the dsn file as a bugreport\n", (long)n->line, (long)n->col); + rnd_message(PCB_MSG_ERROR, "Invalid placement coords (at %ld:%ld) - please send the dsn file as a bugreport\n", (long)n->line, (long)n->col); return -1; } @@ -1604,7 +1604,7 @@ else if (pcb_strcasecmp(STRE(plr->children->children), "mirror_first") == 0) mirror_first = 0; else - pcb_message(PCB_MSG_WARNING, "invalid flip_style: '%s' (at %ld:%ld) - subcircuits may be misplaced - please send the dsn file as a bugreport\n", STRE(plr->children->children), (long)plr->line, (long)plr->col); + rnd_message(PCB_MSG_WARNING, "invalid flip_style: '%s' (at %ld:%ld) - subcircuits may be misplaced - please send the dsn file as a bugreport\n", STRE(plr->children->children), (long)plr->line, (long)plr->col); } } else if (pcb_strcasecmp(plr->str, "component") == 0) { @@ -1630,7 +1630,7 @@ net = pcb_net_get(ctx->pcb, &ctx->pcb->netlist[PCB_NETLIST_INPUT], netname, 1); if (net == NULL) { - pcb_message(PCB_MSG_ERROR, "can not create net: '%s' (at %ld:%ld) - subcircuits may be misplaced - please send the dsn file as a bugreport\n", netname, (long)nwr->children->line, (long)nwr->children->col); + rnd_message(PCB_MSG_ERROR, "can not create net: '%s' (at %ld:%ld) - subcircuits may be misplaced - please send the dsn file as a bugreport\n", netname, (long)nwr->children->line, (long)nwr->children->col); return -1; } for(nwr = nwr->children->next; nwr != NULL; nwr = nwr->next) { @@ -1702,7 +1702,7 @@ ctx->unit = get_unit_struct(su); if (ctx->unit == NULL) { - pcb_message(PCB_MSG_ERROR, "Invalid resolution unit: '%s'\n", su); + rnd_message(PCB_MSG_ERROR, "Invalid resolution unit: '%s'\n", su); return -1; } } @@ -1820,7 +1820,7 @@ fclose(f); if (res != GSX_RES_EOE) { - pcb_message(PCB_MSG_ERROR, "s-expression parse error at offset %ld\n", offs); + rnd_message(PCB_MSG_ERROR, "s-expression parse error at offset %ld\n", offs); return -1; } @@ -1841,11 +1841,11 @@ gsxl_compact_tree(&rdctx.dom); rn = rdctx.dom.root; if ((rn == NULL) || (rn->str == NULL) || (pcb_strcasecmp(rn->str, "pcb") != 0)) { - pcb_message(PCB_MSG_ERROR, "Root node should be pcb, got %s instead\n", rn->str); + rnd_message(PCB_MSG_ERROR, "Root node should be pcb, got %s instead\n", rn->str); goto error; } if (gsxl_next(rn) != NULL) { - pcb_message(PCB_MSG_ERROR, "Multiple root nodes?!\n"); + rnd_message(PCB_MSG_ERROR, "Multiple root nodes?!\n"); goto error; } Index: write.c =================================================================== --- write.c (revision 30902) +++ write.c (revision 30903) @@ -127,7 +127,7 @@ int res = 0; if (pcb_netmap_init(&wctx->nmap, wctx->pcb) != 0) { - pcb_message(PCB_MSG_ERROR, "Can not set up net map\n"); + rnd_message(PCB_MSG_ERROR, "Can not set up net map\n"); return -1; } @@ -166,7 +166,7 @@ } -int io_dsn_write_pcb(pcb_plug_io_t *ctx, FILE *FP, const char *old_filename, const char *new_filename, pcb_bool emergency) +int io_dsn_write_pcb(pcb_plug_io_t *ctx, FILE *FP, const char *old_filename, const char *new_filename, rnd_bool emergency) { dsn_write_t wctx; Index: write.h =================================================================== --- write.h (revision 30902) +++ write.h (revision 30903) @@ -1 +1 @@ -int io_dsn_write_pcb(pcb_plug_io_t *ctx, FILE *FP, const char *old_filename, const char *new_filename, pcb_bool emergency); +int io_dsn_write_pcb(pcb_plug_io_t *ctx, FILE *FP, const char *old_filename, const char *new_filename, rnd_bool emergency);