Index: read.c =================================================================== --- read.c (revision 30902) +++ read.c (revision 30903) @@ -93,7 +93,7 @@ pcb_safe_append_vprintf(&str, 0, fmt, ap); va_end(ap); - pcb_message(PCB_MSG_ERROR, "%s", str.array); + rnd_message(PCB_MSG_ERROR, "%s", str.array); gds_uninit(&str); return -1; @@ -122,7 +122,7 @@ pcb_safe_append_vprintf(&str, 0, fmt, ap); va_end(ap); - pcb_message(PCB_MSG_WARNING, "%s", str.array); + rnd_message(PCB_MSG_WARNING, "%s", str.array); gds_uninit(&str); } @@ -183,11 +183,11 @@ return 0; } -/* Load the pcb_coord_t value of a text node into res. Return 0 on success */ -static int parse_coord(pcb_coord_t *res, lht_node_t *nd) +/* Load the rnd_coord_t value of a text node into res. Return 0 on success */ +static int parse_coord(rnd_coord_t *res, lht_node_t *nd) { double tmp; - pcb_bool success; + rnd_bool success; if (nd == &missing_ok) return 0; @@ -210,7 +210,7 @@ static int parse_angle(pcb_angle_t *res, lht_node_t *nd) { double tmp; - pcb_bool success; + rnd_bool success; if (nd == &missing_ok) return 0; @@ -337,7 +337,7 @@ /* Load the boolean value of a text node into res. Return 0 on success */ -static int parse_bool(pcb_bool *res, lht_node_t *nd) +static int parse_bool(rnd_bool *res, lht_node_t *nd) { char val[8], *end; @@ -374,7 +374,7 @@ static int parse_coord_conf(const char *path, lht_node_t *nd) { - pcb_coord_t tmp; + rnd_coord_t tmp; if (nd == &missing_ok) return 0; @@ -536,7 +536,7 @@ for (n = 0; n < pcb_object_flagbits_len; n++) { long my_types = pcb_object_flagbits[n].object_types | ((rdver <= 4) ? pcb_object_flagbits[n].compat_types : 0); if (my_types & object_type) { - pcb_bool b = 0; + rnd_bool b = 0; if ((parse_bool(&b, hash_get(fn, pcb_object_flagbits[n].name, 1)) == 0) && b) PCB_FLAG_SET(pcb_object_flagbits[n].mask, &fh); } @@ -588,7 +588,7 @@ return 0; } -static int parse_line(pcb_layer_t *ly, lht_node_t *obj, pcb_coord_t dx, pcb_coord_t dy) +static int parse_line(pcb_layer_t *ly, lht_node_t *obj, rnd_coord_t dx, rnd_coord_t dy) { pcb_line_t *line; unsigned char intconn = 0; @@ -664,7 +664,7 @@ return err; } -static int parse_arc(pcb_layer_t *ly, lht_node_t *obj, pcb_coord_t dx, pcb_coord_t dy) +static int parse_arc(pcb_layer_t *ly, lht_node_t *obj, rnd_coord_t dx, rnd_coord_t dy) { pcb_arc_t *arc; unsigned char intconn = 0; @@ -1129,11 +1129,11 @@ iolht_warn(obj, -1, "Lihata from v5 does not support the old data model (elements, pins, pads and vias);\nyour file contains %s that will be converted to the new model\n", type); } -static int parse_via(pcb_data_t *dt, lht_node_t *obj, pcb_coord_t dx, pcb_coord_t dy, int subc_on_bottom) +static int parse_via(pcb_data_t *dt, lht_node_t *obj, rnd_coord_t dx, rnd_coord_t dy, int subc_on_bottom) { pcb_pstk_t *ps; unsigned char intconn = 0; - pcb_coord_t Thickness, Clearance, Mask = 0, DrillingHole, X, Y; + rnd_coord_t Thickness, Clearance, Mask = 0, DrillingHole, X, Y; char *Name = NULL, *Number = NULL; pcb_flag_t flg; lht_node_t *fln; @@ -1182,12 +1182,12 @@ return err; } -static int parse_pad(pcb_subc_t *subc, lht_node_t *obj, pcb_coord_t dx, pcb_coord_t dy, int subc_on_bottom) +static int parse_pad(pcb_subc_t *subc, lht_node_t *obj, rnd_coord_t dx, rnd_coord_t dy, int subc_on_bottom) { pcb_pstk_t *p; unsigned char intconn = 0; pcb_flag_t flg; - pcb_coord_t X1, Y1, X2, Y2, Thickness, Clearance, Mask = 0; + rnd_coord_t X1, Y1, X2, Y2, Thickness, Clearance, Mask = 0; char *Name = NULL, *Number = NULL; int err = 0; long int id; @@ -1235,7 +1235,7 @@ lht_node_t *lst, *n; lht_dom_iterator_t it; int onsld, tdir = 0, tscale = 100; - pcb_coord_t ox = 0, oy = 0, tx, ty; + rnd_coord_t ox = 0, oy = 0, tx, ty; pcb_text_t *txt; int err = 0; @@ -1421,7 +1421,7 @@ pcb_layergrp_fix_turn_to_outline(g); } else - pcb_message(PCB_MSG_ERROR, "failed to create layer %s\n", l->name); + rnd_message(PCB_MSG_ERROR, "failed to create layer %s\n", l->name); } pcb_layergrp_fix_old_outline(pcb); @@ -1897,7 +1897,7 @@ grp = lht_dom_hash_get(nd, "objects"); for(obj = lht_dom_first(&it, grp); obj != NULL; obj = lht_dom_next(&it)) { - pcb_coord_t x1, y1, x2, y2, th, r; + rnd_coord_t x1, y1, x2, y2, th, r; double sa, da; if (strncmp(obj->name, "line.", 5) == 0) { @@ -2218,7 +2218,7 @@ if (cfg_dest == CFR_invalid) return; if (pcb_conf_insert_tree_as(cfg_dest, sub) != 0) - pcb_message(PCB_MSG_ERROR, "Failed to insert the config subtree '%s' found in %s\n", sub->name, pcb->hidlib.filename); + rnd_message(PCB_MSG_ERROR, "Failed to insert the config subtree '%s' found in %s\n", sub->name, pcb->hidlib.filename); else pcb_conf_update(NULL, -1); } @@ -2354,7 +2354,7 @@ free(realfn); if (doc == NULL) { - pcb_message(PCB_MSG_ERROR, "Error loading '%s': %s\n", Filename, errmsg); + rnd_message(PCB_MSG_ERROR, "Error loading '%s': %s\n", Filename, errmsg); free(errmsg); return -1; } @@ -2402,7 +2402,7 @@ free(realfn); if (doc == NULL) { - pcb_message(PCB_MSG_ERROR, "Error loading '%s': %s\n", filename, errmsg); + rnd_message(PCB_MSG_ERROR, "Error loading '%s': %s\n", filename, errmsg); free(errmsg); return -1; } @@ -2499,7 +2499,7 @@ if (doc == NULL) { if (!pcb_io_err_inhibit) - pcb_message(PCB_MSG_ERROR, "Error loading '%s': %s\n", Filename, errmsg); + rnd_message(PCB_MSG_ERROR, "Error loading '%s': %s\n", Filename, errmsg); free(errmsg); return -1; } @@ -2506,7 +2506,7 @@ if ((doc->root->type != LHT_LIST) || (strcmp(doc->root->name, "pcb-rnd-font-v1"))) { if (!pcb_io_err_inhibit) - pcb_message(PCB_MSG_ERROR, "Not a font lihata.\n"); + rnd_message(PCB_MSG_ERROR, "Not a font lihata.\n"); res = -1; } else @@ -2537,7 +2537,7 @@ if (doc == NULL) { if (!pcb_io_err_inhibit) - pcb_message(PCB_MSG_ERROR, "Error loading '%s': %s\n", name, errmsg); + rnd_message(PCB_MSG_ERROR, "Error loading '%s': %s\n", name, errmsg); free(errmsg); return -1; } @@ -2544,7 +2544,7 @@ if ((doc->root->type != LHT_LIST) || (strncmp(doc->root->name, "pcb-rnd-subcircuit-v", 20))) { if (!pcb_io_err_inhibit) - pcb_message(PCB_MSG_ERROR, "Not a subcircuit lihata.\n"); + rnd_message(PCB_MSG_ERROR, "Not a subcircuit lihata.\n"); free(errmsg); lht_dom_uninit(doc); return -1; @@ -2555,7 +2555,7 @@ rdver = atoi(doc->root->name+20); if (rdver < 3) { if (!pcb_io_err_inhibit) - pcb_message(PCB_MSG_ERROR, "io_lihata: invalid subc file version: %s (expected 3 or higher)\n", doc->root->name+20); + rnd_message(PCB_MSG_ERROR, "io_lihata: invalid subc file version: %s (expected 3 or higher)\n", doc->root->name+20); free(errmsg); lht_dom_uninit(doc); return -1; Index: write.c =================================================================== --- write.c (revision 30902) +++ write.c (revision 30903) @@ -264,18 +264,18 @@ if (wrver < 5) { if (pcb_attribute_get(&obj->Attributes, "intnoconn") != NULL) { warned = 1; - pcb_message(PCB_MSG_WARNING, "pcb-rnd versions only reading file older than lihata v5 may ignore the intnoconn flag\n"); + rnd_message(PCB_MSG_WARNING, "pcb-rnd versions only reading file older than lihata v5 may ignore the intnoconn flag\n"); } } if (wrver < 3) { if (pcb_attribute_get(&obj->Attributes, "intconn") != NULL) { warned = 1; - pcb_message(PCB_MSG_WARNING, "pcb-rnd versions only reading file older than lihata v3 may ignore the intconn flag\n"); + rnd_message(PCB_MSG_WARNING, "pcb-rnd versions only reading file older than lihata v3 may ignore the intconn flag\n"); } } if (warned) - pcb_message(PCB_MSG_WARNING, "^^^ in %s #%ld\n", pcb_obj_type_name(obj->type), obj->ID); + rnd_message(PCB_MSG_WARNING, "^^^ in %s #%ld\n", pcb_obj_type_name(obj->type), obj->ID); } /* Write the thermal list of heavy terminals; put the resulting "thermal" @@ -303,7 +303,7 @@ } -static lht_node_t *build_line(pcb_line_t *line, int local_id, pcb_coord_t dx, pcb_coord_t dy, int simple) +static lht_node_t *build_line(pcb_line_t *line, int local_id, rnd_coord_t dx, rnd_coord_t dy, int simple) { char buff[128]; lht_node_t *obj; @@ -386,7 +386,7 @@ return obj; } -static lht_node_t *build_arc(pcb_arc_t *arc, pcb_coord_t dx, pcb_coord_t dy) +static lht_node_t *build_arc(pcb_arc_t *arc, rnd_coord_t dx, rnd_coord_t dy) { char buff[128]; lht_node_t *obj; @@ -413,13 +413,13 @@ } /* attempt to convert a padstack to an old-style via for v1, v2 and v3 */ -static lht_node_t *build_pstk_pinvia(pcb_data_t *data, pcb_pstk_t *ps, pcb_bool is_via, pcb_coord_t dx, pcb_coord_t dy) +static lht_node_t *build_pstk_pinvia(pcb_data_t *data, pcb_pstk_t *ps, rnd_bool is_via, rnd_coord_t dx, rnd_coord_t dy) { char buff[128]; lht_node_t *obj; - pcb_coord_t x, y, drill_dia, pad_dia, clearance, mask; + rnd_coord_t x, y, drill_dia, pad_dia, clearance, mask; pcb_pstk_compshape_t cshape; - pcb_bool plated; + rnd_bool plated; pcb_flag_t flg; char *name = pcb_attribute_get(&ps->Attributes, "name"); @@ -450,12 +450,12 @@ } /* attempt to convert a padstack to an old-style pad for v1, v2 and v3 */ -static lht_node_t *build_pstk_pad(pcb_data_t *data, pcb_pstk_t *ps, pcb_coord_t dx, pcb_coord_t dy) +static lht_node_t *build_pstk_pad(pcb_data_t *data, pcb_pstk_t *ps, rnd_coord_t dx, rnd_coord_t dy) { char buff[128]; lht_node_t *obj; - pcb_coord_t x1, y1, x2, y2, thickness, clearance, mask; - pcb_bool square, nopaste; + rnd_coord_t x1, y1, x2, y2, thickness, clearance, mask; + rnd_bool square, nopaste; char *name = pcb_attribute_get(&ps->Attributes, "name"); pcb_flag_t flg; @@ -583,7 +583,7 @@ { char buff[128]; lht_node_t *obj, *lst; - pcb_coord_t ox, oy; + rnd_coord_t ox, oy; gdl_iterator_t it; int l, seen_refdes = 0; pcb_pstk_t *ps; @@ -809,7 +809,7 @@ nshapeo = build_text("ps_hshadow", ""); break; default: - pcb_message(PCB_MSG_ERROR, "Internal error: unimplemented pad stack shape %d\n", shape->shape); + rnd_message(PCB_MSG_ERROR, "Internal error: unimplemented pad stack shape %d\n", shape->shape); abort(); } lht_dom_hash_put(nshape, nshapeo); @@ -954,10 +954,10 @@ lht_dom_hash_put(obj, dummy_node("purpose")); } else if (layer->meta.bound.purpose != NULL) - pcb_message(PCB_MSG_WARNING, "io_lihata: attempting to save bound layer with a purpose string - not supported in lihata board below v6. Layer binding might be broken after load.\n"); + rnd_message(PCB_MSG_WARNING, "io_lihata: attempting to save bound layer with a purpose string - not supported in lihata board below v6. Layer binding might be broken after load.\n"); } else - pcb_message(PCB_MSG_WARNING, "io_lihata: attempting to save bound layers in lihata version lower than 3; feature not supported by the format.\n"); + rnd_message(PCB_MSG_WARNING, "io_lihata: attempting to save bound layers in lihata version lower than 3; feature not supported by the format.\n"); } if (!layer->is_bound) @@ -1457,8 +1457,8 @@ { /* for coords, preserve formatting as long as values match */ if (lhtpers_rule_find(io_lihata_out_coords, inmem_node) != NULL) { - pcb_coord_t v1, v2; - pcb_bool success1, success2; + rnd_coord_t v1, v2; + rnd_bool success1, success2; /* fprintf(stderr, "SMART d='%s' m='%s'\n", ondisk_value, inmem_node->data.text.value);*/ @@ -1497,7 +1497,7 @@ } } -static int io_lihata_write_pcb(pcb_plug_io_t *ctx, FILE * FP, const char *old_filename, const char *new_filename, pcb_bool emergency, int ver) +static int io_lihata_write_pcb(pcb_plug_io_t *ctx, FILE * FP, const char *old_filename, const char *new_filename, rnd_bool emergency, int ver) { int res; lht_doc_t *brd; @@ -1506,7 +1506,7 @@ brd = build_board(PCB); if (brd == NULL) { - pcb_message(PCB_MSG_ERROR, "Failed to build the board at that version - nothing is written\n"); + rnd_message(PCB_MSG_ERROR, "Failed to build the board at that version - nothing is written\n"); return -1; } @@ -1575,8 +1575,8 @@ res = lht_dom_export(brd->root, fe, ""); fclose(fe); } - pcb_message(PCB_MSG_ERROR, "lhtpers_fsave_as() failed. Please include files %s and %s and %s in your bugreport\n", inf, old_filename, fe_name); - pcb_message(PCB_MSG_ERROR, "in case this broke your file %s, please use the emergency save %s instead.\n", old_filename, fe_name); + rnd_message(PCB_MSG_ERROR, "lhtpers_fsave_as() failed. Please include files %s and %s and %s in your bugreport\n", inf, old_filename, fe_name); + rnd_message(PCB_MSG_ERROR, "in case this broke your file %s, please use the emergency save %s instead.\n", old_filename, fe_name); } fflush(FP); if (inf != NULL) @@ -1587,32 +1587,32 @@ return res; } -int io_lihata_write_pcb_v1(pcb_plug_io_t *ctx, FILE * FP, const char *old_filename, const char *new_filename, pcb_bool emergency) +int io_lihata_write_pcb_v1(pcb_plug_io_t *ctx, FILE * FP, const char *old_filename, const char *new_filename, rnd_bool emergency) { return io_lihata_write_pcb(ctx, FP, old_filename, new_filename, emergency, 1); } -int io_lihata_write_pcb_v2(pcb_plug_io_t *ctx, FILE * FP, const char *old_filename, const char *new_filename, pcb_bool emergency) +int io_lihata_write_pcb_v2(pcb_plug_io_t *ctx, FILE * FP, const char *old_filename, const char *new_filename, rnd_bool emergency) { return io_lihata_write_pcb(ctx, FP, old_filename, new_filename, emergency, 2); } -int io_lihata_write_pcb_v3(pcb_plug_io_t *ctx, FILE * FP, const char *old_filename, const char *new_filename, pcb_bool emergency) +int io_lihata_write_pcb_v3(pcb_plug_io_t *ctx, FILE * FP, const char *old_filename, const char *new_filename, rnd_bool emergency) { return io_lihata_write_pcb(ctx, FP, old_filename, new_filename, emergency, 3); } -int io_lihata_write_pcb_v4(pcb_plug_io_t *ctx, FILE * FP, const char *old_filename, const char *new_filename, pcb_bool emergency) +int io_lihata_write_pcb_v4(pcb_plug_io_t *ctx, FILE * FP, const char *old_filename, const char *new_filename, rnd_bool emergency) { return io_lihata_write_pcb(ctx, FP, old_filename, new_filename, emergency, 4); } -int io_lihata_write_pcb_v5(pcb_plug_io_t *ctx, FILE * FP, const char *old_filename, const char *new_filename, pcb_bool emergency) +int io_lihata_write_pcb_v5(pcb_plug_io_t *ctx, FILE * FP, const char *old_filename, const char *new_filename, rnd_bool emergency) { return io_lihata_write_pcb(ctx, FP, old_filename, new_filename, emergency, 5); } -int io_lihata_write_pcb_v6(pcb_plug_io_t *ctx, FILE * FP, const char *old_filename, const char *new_filename, pcb_bool emergency) +int io_lihata_write_pcb_v6(pcb_plug_io_t *ctx, FILE * FP, const char *old_filename, const char *new_filename, rnd_bool emergency) { return io_lihata_write_pcb(ctx, FP, old_filename, new_filename, emergency, 6); } @@ -1626,7 +1626,7 @@ f = pcb_fopen_askovr(&PCB->hidlib, Filename, "w", NULL); if (f == NULL) { - pcb_message(PCB_MSG_ERROR, "Failed to open font file %s for write\n", Filename); + rnd_message(PCB_MSG_ERROR, "Failed to open font file %s for write\n", Filename); return -1; } @@ -1674,7 +1674,7 @@ TODO("subc: for subc-in-subc this should be recursive") if (padstacklist_first(&sc->data->padstack) != NULL) { if (wrver < 4) { - pcb_message(PCB_MSG_WARNING, "Had to bump lihata subc version to 4 because the subcircuit contains padstacks.\n"); + rnd_message(PCB_MSG_WARNING, "Had to bump lihata subc version to 4 because the subcircuit contains padstacks.\n"); wrver = 4; } } @@ -1686,7 +1686,7 @@ else if (wrver >= 6) doc->root = lht_dom_node_alloc(LHT_LIST, "pcb-rnd-subcircuit-v6"); else { - pcb_message(PCB_MSG_ERROR, "Invalid lihata subc version to write: %d\n", wrver); + rnd_message(PCB_MSG_ERROR, "Invalid lihata subc version to write: %d\n", wrver); return -1; } @@ -1703,7 +1703,7 @@ int io_lihata_write_subcs_head(pcb_plug_io_t *ctx, void **udata, FILE *f, int lib, long num_subcs) { if ((lib) || (num_subcs != 1)) { - pcb_message(PCB_MSG_ERROR, "Only one subcircuit per footprint file can be written in lihata\n"); + rnd_message(PCB_MSG_ERROR, "Only one subcircuit per footprint file can be written in lihata\n"); return -1; } return 0; @@ -1781,7 +1781,7 @@ return save; } -void io_lihata_save_as_subd_uninit(const pcb_plug_io_t *ctx, void *plg_ctx, pcb_hid_dad_subdialog_t *sub, pcb_bool apply) +void io_lihata_save_as_subd_uninit(const pcb_plug_io_t *ctx, void *plg_ctx, pcb_hid_dad_subdialog_t *sub, rnd_bool apply) { io_lihata_save_t *save = plg_ctx; Index: write.h =================================================================== --- write.h (revision 30902) +++ write.h (revision 30903) @@ -26,12 +26,12 @@ #include "plug_io.h" -int io_lihata_write_pcb_v1(pcb_plug_io_t *ctx, FILE *FP, const char *old_filename, const char *new_filename, pcb_bool emergency); -int io_lihata_write_pcb_v2(pcb_plug_io_t *ctx, FILE *FP, const char *old_filename, const char *new_filename, pcb_bool emergency); -int io_lihata_write_pcb_v3(pcb_plug_io_t *ctx, FILE *FP, const char *old_filename, const char *new_filename, pcb_bool emergency); -int io_lihata_write_pcb_v4(pcb_plug_io_t *ctx, FILE *FP, const char *old_filename, const char *new_filename, pcb_bool emergency); -int io_lihata_write_pcb_v5(pcb_plug_io_t *ctx, FILE *FP, const char *old_filename, const char *new_filename, pcb_bool emergency); -int io_lihata_write_pcb_v6(pcb_plug_io_t *ctx, FILE *FP, const char *old_filename, const char *new_filename, pcb_bool emergency); +int io_lihata_write_pcb_v1(pcb_plug_io_t *ctx, FILE *FP, const char *old_filename, const char *new_filename, rnd_bool emergency); +int io_lihata_write_pcb_v2(pcb_plug_io_t *ctx, FILE *FP, const char *old_filename, const char *new_filename, rnd_bool emergency); +int io_lihata_write_pcb_v3(pcb_plug_io_t *ctx, FILE *FP, const char *old_filename, const char *new_filename, rnd_bool emergency); +int io_lihata_write_pcb_v4(pcb_plug_io_t *ctx, FILE *FP, const char *old_filename, const char *new_filename, rnd_bool emergency); +int io_lihata_write_pcb_v5(pcb_plug_io_t *ctx, FILE *FP, const char *old_filename, const char *new_filename, rnd_bool emergency); +int io_lihata_write_pcb_v6(pcb_plug_io_t *ctx, FILE *FP, const char *old_filename, const char *new_filename, rnd_bool emergency); int io_lihata_write_font(pcb_plug_io_t *ctx, pcb_font_t *font, const char *Filename); int io_lihata_write_buffer(pcb_plug_io_t *ctx, FILE *f, pcb_buffer_t *buff); int io_lihata_write_subcs_head(pcb_plug_io_t *ctx, void **udata, FILE *f, int lib, long num_subcs); @@ -39,5 +39,5 @@ int io_lihata_write_subcs_tail(pcb_plug_io_t *ctx, void **udata, FILE *f); void *io_lihata_save_as_subd_init(const pcb_plug_io_t *ctx, pcb_hid_dad_subdialog_t *sub, pcb_plug_iot_t type); -void io_lihata_save_as_subd_uninit(const pcb_plug_io_t *ctx, void *plg_ctx, pcb_hid_dad_subdialog_t *sub, pcb_bool apply); +void io_lihata_save_as_subd_uninit(const pcb_plug_io_t *ctx, void *plg_ctx, pcb_hid_dad_subdialog_t *sub, rnd_bool apply); void io_lihata_save_as_fmt_changed(const pcb_plug_io_t *ctx, void *plg_ctx, pcb_hid_dad_subdialog_t *sub);