Index: vendor.c =================================================================== --- vendor.c (revision 30902) +++ vendor.c (revision 30903) @@ -58,13 +58,13 @@ static void add_to_drills(char *); static void apply_vendor_map(void); static void process_skips(lht_node_t *); -static pcb_bool rematch(const char *, const char *); +static rnd_bool rematch(const char *, const char *); static void vendor_free_all(void); -pcb_coord_t vendorDrillMap(pcb_coord_t in); +rnd_coord_t vendorDrillMap(rnd_coord_t in); /* list of vendor drills and a count of them */ -static pcb_coord_t *vendor_drills = NULL; +static rnd_coord_t *vendor_drills = NULL; static int n_vendor_drills = 0; static int cached_drill = -1; @@ -93,7 +93,7 @@ #define FREE(x) if((x) != NULL) { free (x) ; (x) = NULL; } /* load a board metadata into conf_core */ -static void load_meta_coord(const char *path, pcb_coord_t crd) +static void load_meta_coord(const char *path, rnd_coord_t crd) { char tmp[128]; pcb_sprintf(tmp, "%$mm", crd); @@ -100,7 +100,7 @@ pcb_conf_set(CFR_DESIGN, path, -1, tmp, POL_OVERWRITE); } -static pcb_bool vendorIsSubcMappable(pcb_subc_t *subc); +static rnd_bool vendorIsSubcMappable(pcb_subc_t *subc); static const char apply_vendor_syntax[] = "ApplyVendor()"; @@ -137,7 +137,7 @@ const char *sval; lht_doc_t *doc; lht_node_t *drlres; - pcb_bool free_fname = pcb_false; + rnd_bool free_fname = pcb_false; cached_drill = -1; @@ -168,7 +168,7 @@ /* load the resource file */ doc = pcb_hid_cfg_load_lht(&PCB->hidlib, fname); if (doc == NULL) { - pcb_message(PCB_MSG_ERROR, "Could not load vendor resource file \"%s\"\n", fname); + rnd_message(PCB_MSG_ERROR, "Could not load vendor resource file \"%s\"\n", fname); RND_ACT_IRES(1); return 0; } @@ -191,7 +191,7 @@ sf = PCB_MM_TO_COORD(1); } else { - pcb_message(PCB_MSG_ERROR, "\"%s\" is not a supported units. Defaulting to inch\n", sval); + rnd_message(PCB_MSG_ERROR, "\"%s\" is not a supported units. Defaulting to inch\n", sval); sf = PCB_INCH_TO_COORD(1); } @@ -206,7 +206,7 @@ rounding_method = CLOSEST; } else { - pcb_message(PCB_MSG_ERROR, "\"%s\" is not a valid rounding type. Defaulting to up\n", sval); + rnd_message(PCB_MSG_ERROR, "\"%s\" is not a valid rounding type. Defaulting to up\n", sval); rounding_method = ROUND_UP; } } @@ -226,49 +226,49 @@ } } else - pcb_message(PCB_MSG_ERROR, "Broken drillmap: /drillmap should be a list\n"); + rnd_message(PCB_MSG_ERROR, "Broken drillmap: /drillmap should be a list\n"); } else - pcb_message(PCB_MSG_ERROR, "No drillmap resource found\n"); + rnd_message(PCB_MSG_ERROR, "No drillmap resource found\n"); sval = pcb_hid_cfg_text_value(doc, "/drc/copper_space"); if (sval != NULL) { load_meta_coord("design/bloat", floor(sf * atof(sval) + 0.5)); - pcb_message(PCB_MSG_INFO, "Set DRC minimum copper spacing to %ml mils\n", conf_core.design.bloat); + rnd_message(PCB_MSG_INFO, "Set DRC minimum copper spacing to %ml mils\n", conf_core.design.bloat); } sval = pcb_hid_cfg_text_value(doc, "/drc/copper_overlap"); if (sval != NULL) { load_meta_coord("design/shrink", floor(sf * atof(sval) + 0.5)); - pcb_message(PCB_MSG_INFO, "Set DRC minimum copper overlap to %ml mils\n", conf_core.design.shrink); + rnd_message(PCB_MSG_INFO, "Set DRC minimum copper overlap to %ml mils\n", conf_core.design.shrink); } sval = pcb_hid_cfg_text_value(doc, "/drc/copper_width"); if (sval != NULL) { load_meta_coord("design/min_wid", floor(sf * atof(sval) + 0.5)); - pcb_message(PCB_MSG_INFO, "Set DRC minimum copper spacing to %ml mils\n", conf_core.design.min_wid); + rnd_message(PCB_MSG_INFO, "Set DRC minimum copper spacing to %ml mils\n", conf_core.design.min_wid); } sval = pcb_hid_cfg_text_value(doc, "/drc/silk_width"); if (sval != NULL) { load_meta_coord("design/min_slk", floor(sf * atof(sval) + 0.5)); - pcb_message(PCB_MSG_INFO, "Set DRC minimum silk width to %ml mils\n", conf_core.design.min_slk); + rnd_message(PCB_MSG_INFO, "Set DRC minimum silk width to %ml mils\n", conf_core.design.min_slk); } sval = pcb_hid_cfg_text_value(doc, "/drc/min_drill"); if (sval != NULL) { load_meta_coord("design/min_drill", floor(sf * atof(sval) + 0.5)); - pcb_message(PCB_MSG_INFO, "Set DRC minimum drill diameter to %ml mils\n", conf_core.design.min_drill); + rnd_message(PCB_MSG_INFO, "Set DRC minimum drill diameter to %ml mils\n", conf_core.design.min_drill); } sval = pcb_hid_cfg_text_value(doc, "/drc/min_ring"); if (sval != NULL) { load_meta_coord("design/min_ring", floor(sf * atof(sval) + 0.5)); - pcb_message(PCB_MSG_INFO, "Set DRC minimum annular ring to %ml mils\n", conf_core.design.min_ring); + rnd_message(PCB_MSG_INFO, "Set DRC minimum annular ring to %ml mils\n", conf_core.design.min_ring); } - pcb_message(PCB_MSG_INFO, "Loaded %d vendor drills from %s\n", n_vendor_drills, fname); - pcb_message(PCB_MSG_INFO, "Loaded %d RefDes skips, %d Value skips, %d Descr skips\n", n_refdes, n_value, n_descr); + rnd_message(PCB_MSG_INFO, "Loaded %d vendor drills from %s\n", n_vendor_drills, fname); + rnd_message(PCB_MSG_INFO, "Loaded %d RefDes skips, %d Value skips, %d Descr skips\n", n_refdes, n_value, n_descr); pcb_conf_set(CFR_DESIGN, "plugins/vendor/enable", -1, "0", POL_OVERWRITE); @@ -283,7 +283,7 @@ static int apply_vendor_pstk1(pcb_pstk_t *pstk, pcb_cardinal_t *tot) { pcb_pstk_proto_t *proto = pcb_pstk_get_proto(pstk); - pcb_coord_t target; + rnd_coord_t target; int res = 0; if ((proto == NULL) || (proto->hdia == 0)) return 0; @@ -295,7 +295,7 @@ if (pcb_chg_obj_2nd_size(PCB_OBJ_PSTK, pstk, pstk, pstk, target, pcb_true, pcb_false)) res = 1; else { - pcb_message(PCB_MSG_WARNING, + rnd_message(PCB_MSG_WARNING, "Padstack at %ml, %ml not changed. Possible reasons:\n" "\t- pad size too small\n" "\t- new size would be too large or too small\n", pstk->x, pstk->y); @@ -320,7 +320,7 @@ { int i; pcb_cardinal_t changed = 0, tot = 0; - pcb_bool state; + rnd_bool state; state = conf_vendor.plugins.vendor.enable; @@ -340,13 +340,13 @@ } PCB_END_LOOP; - pcb_message(PCB_MSG_INFO, "Updated %ld drill sizes out of %ld total\n", (long)changed, (long)tot); + rnd_message(PCB_MSG_INFO, "Updated %ld drill sizes out of %ld total\n", (long)changed, (long)tot); /* Update the current Via */ if (conf_core.design.via_drilling_hole != vendorDrillMap(conf_core.design.via_drilling_hole)) { changed++; pcb_conf_setf(CFR_DESIGN, "design/via_drilling_hole", -1, "%$mm", vendorDrillMap(conf_core.design.via_drilling_hole)); - pcb_message(PCB_MSG_INFO, "Adjusted active via hole size to be %ml mils\n", conf_core.design.via_drilling_hole); + rnd_message(PCB_MSG_INFO, "Adjusted active via hole size to be %ml mils\n", conf_core.design.via_drilling_hole); } /* and update the vias for the various routing styles */ @@ -354,12 +354,12 @@ if (PCB->RouteStyle.array[i].Hole != vendorDrillMap(PCB->RouteStyle.array[i].Hole)) { changed++; PCB->RouteStyle.array[i].Hole = vendorDrillMap(PCB->RouteStyle.array[i].Hole); - pcb_message(PCB_MSG_INFO, + rnd_message(PCB_MSG_INFO, "Adjusted %s routing style hole size to be %ml mils\n", PCB->RouteStyle.array[i].name, PCB->RouteStyle.array[i].Hole); if (PCB->RouteStyle.array[i].Diameter < PCB->RouteStyle.array[i].Hole + PCB_MIN_PINORVIACOPPER) { PCB->RouteStyle.array[i].Diameter = PCB->RouteStyle.array[i].Hole + PCB_MIN_PINORVIACOPPER; - pcb_message(PCB_MSG_INFO, + rnd_message(PCB_MSG_INFO, "Increased %s routing style via diameter to %ml mils\n", PCB->RouteStyle.array[i].name, PCB->RouteStyle.array[i].Diameter); } @@ -382,7 +382,7 @@ } /* for a given drill size, find the closest vendor drill size */ -pcb_coord_t vendorDrillMap(pcb_coord_t in) +rnd_coord_t vendorDrillMap(rnd_coord_t in) { int i, min, max; @@ -405,7 +405,7 @@ /* are we larger than the largest drill? */ if (in > vendor_drills[n_vendor_drills - 1]) { - pcb_message(PCB_MSG_ERROR, "Vendor drill list does not contain a drill >= %ml mil\n" + rnd_message(PCB_MSG_ERROR, "Vendor drill list does not contain a drill >= %ml mil\n" "Using %ml mil instead.\n", in, vendor_drills[n_vendor_drills - 1]); cached_map = vendor_drills[n_vendor_drills - 1]; return vendor_drills[n_vendor_drills - 1]; @@ -531,7 +531,7 @@ } } -static pcb_bool vendorIsSubcMappable(pcb_subc_t *subc) +static rnd_bool vendorIsSubcMappable(pcb_subc_t *subc) { int i; int noskip; @@ -544,7 +544,7 @@ for (i = 0; i < n_refdes; i++) { if ((PCB_NSTRCMP(PCB_UNKNOWN(subc->refdes), ignore_refdes[i]) == 0) || rematch(ignore_refdes[i], PCB_UNKNOWN(subc->refdes))) { - pcb_message(PCB_MSG_INFO, "Vendor mapping skipped because refdes = %s matches %s\n", PCB_UNKNOWN(subc->refdes), ignore_refdes[i]); + rnd_message(PCB_MSG_INFO, "Vendor mapping skipped because refdes = %s matches %s\n", PCB_UNKNOWN(subc->refdes), ignore_refdes[i]); noskip = 0; } } @@ -553,7 +553,7 @@ for (i = 0; i < n_value; i++) { if ((PCB_NSTRCMP(PCB_UNKNOWN(vl), ignore_value[i]) == 0) || rematch(ignore_value[i], PCB_UNKNOWN(vl))) { - pcb_message(PCB_MSG_INFO, "Vendor mapping skipped because value = %s matches %s\n", PCB_UNKNOWN(vl), ignore_value[i]); + rnd_message(PCB_MSG_INFO, "Vendor mapping skipped because value = %s matches %s\n", PCB_UNKNOWN(vl), ignore_value[i]); noskip = 0; } } @@ -564,7 +564,7 @@ for (i = 0; i < n_descr; i++) { if ((PCB_NSTRCMP(PCB_UNKNOWN(fp), ignore_descr[i]) == 0) || rematch(ignore_descr[i], PCB_UNKNOWN(fp))) { - pcb_message(PCB_MSG_INFO, + rnd_message(PCB_MSG_INFO, "Vendor mapping skipped because descr = %s matches %s\n", PCB_UNKNOWN(fp), ignore_descr[i]); noskip = 0; @@ -573,7 +573,7 @@ } if (noskip && PCB_FLAG_TEST(PCB_FLAG_LOCK, subc)) { - pcb_message(PCB_MSG_INFO, "Vendor mapping skipped because element %s is locked\n", PCB_UNKNOWN(subc->refdes)); + rnd_message(PCB_MSG_INFO, "Vendor mapping skipped because element %s is locked\n", PCB_UNKNOWN(subc->refdes)); noskip = 0; } @@ -583,7 +583,7 @@ return pcb_false; } -static pcb_bool rematch(const char *re, const char *s) +static rnd_bool rematch(const char *re, const char *s) { int result; re_sei_t *regex; @@ -591,7 +591,7 @@ /* compile the regular expression */ regex = re_sei_comp(re); if (re_sei_errno(regex) != 0) { - pcb_message(PCB_MSG_ERROR, "regexp error: %s\n", re_error_str(re_sei_errno(regex))); + rnd_message(PCB_MSG_ERROR, "regexp error: %s\n", re_error_str(re_sei_errno(regex))); re_sei_free(regex); return pcb_false; }