Index: trunk/doc-rnd/hacking/renames =================================================================== --- trunk/doc-rnd/hacking/renames (revision 4912) +++ trunk/doc-rnd/hacking/renames (revision 4913) @@ -457,3 +457,10 @@ SGNZ -> PCB_SGNZ SWAP_SIGN_X -> PCB_SWAP_SIGN_X SWAP_SIGN_Y -> PCB_SWAP_SIGN_Y +Distance2 -> pcb_distance2 +Distance -> pcb_distance +GetValue -> pcb_get_value +GetValueEx -> pcb_get_value_ex +GetNum -> pcb_get_num +Concat -> pcb_concat +StripWhiteSpaceAndDup -> pcb_strdup_strip_wspace Index: trunk/src/action_helper.c =================================================================== --- trunk/src/action_helper.c (revision 4912) +++ trunk/src/action_helper.c (revision 4913) @@ -507,9 +507,9 @@ } else if (type == PCB_TYPE_PAD) { pcb_pad_t *pad = (pcb_pad_t *) ptr2; - double d1 = Distance(Crosshair.X, Crosshair.Y, pad->Point1.X, pad->Point1.Y); - double d2 = Distance(Crosshair.X, Crosshair.Y, pad->Point2.X, pad->Point2.Y); - double dm = Distance(Crosshair.X, Crosshair.Y, (pad->Point1.X + pad->Point2.X) / 2, (pad->Point1.Y + pad->Point2.Y)/2); + double d1 = pcb_distance(Crosshair.X, Crosshair.Y, pad->Point1.X, pad->Point1.Y); + double d2 = pcb_distance(Crosshair.X, Crosshair.Y, pad->Point2.X, pad->Point2.Y); + double dm = pcb_distance(Crosshair.X, Crosshair.Y, (pad->Point1.X + pad->Point2.X) / 2, (pad->Point1.Y + pad->Point2.Y)/2); if ((dm <= d1) && (dm <= d2)) { /* prefer to snap to the middle of a pin if that's the closest */ Crosshair.AttachedLine.Point1.X = Crosshair.AttachedLine.Point2.X = Crosshair.X; Crosshair.AttachedLine.Point1.Y = Crosshair.AttachedLine.Point2.Y = Crosshair.Y; Index: trunk/src/box.h =================================================================== --- trunk/src/box.h (revision 4912) +++ trunk/src/box.h (revision 4913) @@ -219,7 +219,7 @@ static inline PCB_FUNC_UNUSED double pcb_dist2_to_box(const pcb_cheap_point_t * p, const pcb_box_t * b) { pcb_cheap_point_t r = pcb_closest_pcb_point_in_box(p, b); - return Distance(r.X, r.Y, p->X, p->Y); + return pcb_distance(r.X, r.Y, p->X, p->Y); } pcb_box_t *pcb_box_new(pcb_box_list_t *); Index: trunk/src/buffer.c =================================================================== --- trunk/src/buffer.c (revision 4912) +++ trunk/src/buffer.c (revision 4913) @@ -855,10 +855,10 @@ x = y = 0; } else if (argc == 3 || argc == 4) { - x = GetValue(PCB_ACTION_ARG(1), PCB_ACTION_ARG(3), &absolute, NULL); + x = pcb_get_value(PCB_ACTION_ARG(1), PCB_ACTION_ARG(3), &absolute, NULL); if (!absolute) x += oldx; - y = GetValue(PCB_ACTION_ARG(2), PCB_ACTION_ARG(3), &absolute, NULL); + y = pcb_get_value(PCB_ACTION_ARG(2), PCB_ACTION_ARG(3), &absolute, NULL); if (!absolute) y += oldy; } Index: trunk/src/change_act.c =================================================================== --- trunk/src/change_act.c (revision 4912) +++ trunk/src/change_act.c (revision 4913) @@ -94,7 +94,7 @@ value *= 2; } else - value = 2 * GetValue(delta, units, &absolute, NULL); + value = 2 * pcb_get_value(delta, units, &absolute, NULL); switch (pcb_funchash_get(function, NULL)) { case F_Object: { @@ -404,7 +404,7 @@ tostyle = 1; } else - value = GetValue(delta, units, &absolute, NULL); + value = pcb_get_value(delta, units, &absolute, NULL); switch (funcid) { case F_Object: { @@ -507,7 +507,7 @@ absolute = 1; } else - value = GetValue(delta, units, &absolute, NULL); + value = pcb_get_value(delta, units, &absolute, NULL); switch (pcb_funchash_get(function, NULL)) { case F_Object: @@ -1183,7 +1183,7 @@ if (function && *function && style && *style) { pcb_bool absolute; - kind = GetValue(style, NULL, &absolute, NULL); + kind = pcb_get_value(style, NULL, &absolute, NULL); if (absolute) switch (pcb_funchash_get(function, NULL)) { case F_Object: @@ -1317,7 +1317,7 @@ int err = 0; if (function && val) { - value = GetValue(val, units, &absolute, NULL); + value = pcb_get_value(val, units, &absolute, NULL); switch (pcb_funchash_get(function, NULL)) { case F_ViaDrillingHole: SetViaDrillingHole(absolute ? value : value + conf_core.design.via_drilling_hole, pcb_false); @@ -1470,7 +1470,7 @@ if (funcid == F_Object) type = SearchScreen(Crosshair.X, Crosshair.Y, CHANGESIZE_TYPES, &ptr1, &ptr2, &ptr3); - value = GetValue(delta, units, &absolute, NULL); + value = pcb_get_value(delta, units, &absolute, NULL); switch (funcid) { case F_Object: Index: trunk/src/conf.c =================================================================== --- trunk/src/conf.c (revision 4912) +++ trunk/src/conf.c (revision 4913) @@ -255,7 +255,7 @@ if (val != NULL) {\ if (val->type == LHT_TEXT) {\ pcb_bool succ; \ - inc->field = GetValue(val->data.text.value, NULL, NULL, &succ); \ + inc->field = pcb_get_value(val->data.text.value, NULL, NULL, &succ); \ if (!succ) \ pcb_hid_cfg_error(node, "invalid numeric value in increment field " #field ": %s\n", val->data.text.value); \ } \ @@ -378,7 +378,7 @@ case CFN_COORD: { pcb_bool succ; - dst->coord[idx] = GetValue(text, NULL, NULL, &succ); + dst->coord[idx] = pcb_get_value(text, NULL, NULL, &succ); if (!succ) pcb_hid_cfg_error(err_node, "Invalid numeric value (coordinate): %s\n", text); } Index: trunk/src/conf_act.c =================================================================== --- trunk/src/conf_act.c (revision 4912) +++ trunk/src/conf_act.c (revision 4913) @@ -242,7 +242,7 @@ if (strcmp(argv[0], "none") == 0) return PCB->Grid <= 300; - return (PCB->Grid == GetValueEx(argv[0], NULL, NULL, NULL, NULL, NULL)); + return (PCB->Grid == pcb_get_value_ex(argv[0], NULL, NULL, NULL, NULL, NULL)); } static const char ChkElementName_syntax[] = Index: trunk/src/file_act.c =================================================================== --- trunk/src/file_act.c (revision 4912) +++ trunk/src/file_act.c (revision 4913) @@ -139,7 +139,7 @@ else if (strcasecmp(function, "Netlist") == 0) { if (PCB->Netlistname) free(PCB->Netlistname); - PCB->Netlistname = StripWhiteSpaceAndDup(name); + PCB->Netlistname = pcb_strdup_strip_wspace(name); { int i; for (i = 0; i < NUM_NETLISTS; i++) Index: trunk/src/find_geo.c =================================================================== --- trunk/src/find_geo.c (revision 4912) +++ trunk/src/find_geo.c (revision 4913) @@ -145,7 +145,7 @@ pdx = Arc2->X - Arc1->X; pdy = Arc2->Y - Arc1->Y; - dl = Distance(Arc1->X, Arc1->Y, Arc2->X, Arc2->Y); + dl = pcb_distance(Arc1->X, Arc1->Y, Arc2->X, Arc2->Y); /* concentric arcs, simpler intersection conditions */ if (dl < 0.5) { if ((Arc1->Width - t >= Arc2->Width - t2 && Arc1->Width - t <= Arc2->Width + t2) @@ -250,7 +250,7 @@ else { pcb_coord_t dX = l->Point2.X - l->Point1.X; pcb_coord_t dY = l->Point2.Y - l->Point1.Y; - double r = Distance(l->Point1.X, l->Point1.Y, l->Point2.X, l->Point2.Y); + double r = pcb_distance(l->Point1.X, l->Point1.Y, l->Point2.X, l->Point2.Y); dwx = l->Thickness / 2.0 / r * dX; dwy = l->Thickness / 2.0 / r * dY; } Index: trunk/src/gui_act.c =================================================================== --- trunk/src/gui_act.c (revision 4912) +++ trunk/src/gui_act.c (revision 4913) @@ -529,8 +529,8 @@ switch (pcb_funchash_get(function, NULL)) { case F_ToggleGrid: if (argc > 2) { - PCB->GridOffsetX = GetValue(argv[1], NULL, NULL, NULL); - PCB->GridOffsetY = GetValue(argv[2], NULL, NULL, NULL); + PCB->GridOffsetX = pcb_get_value(argv[1], NULL, NULL, NULL); + PCB->GridOffsetY = pcb_get_value(argv[2], NULL, NULL, NULL); if (conf_core.editor.draw_grid) pcb_redraw(); } Index: trunk/src/hid_attrib.c =================================================================== --- trunk/src/hid_attrib.c (revision 4912) +++ trunk/src/hid_attrib.c (revision 4913) @@ -122,9 +122,9 @@ break; case HID_Coord: if (a->value) - *(pcb_coord_t *) a->value = GetValue((*argv)[1], NULL, NULL, NULL); + *(pcb_coord_t *) a->value = pcb_get_value((*argv)[1], NULL, NULL, NULL); else - a->default_val.coord_value = GetValue((*argv)[1], NULL, NULL, NULL); + a->default_val.coord_value = pcb_get_value((*argv)[1], NULL, NULL, NULL); (*argc)--; (*argv)++; break; Index: trunk/src/hid_init.c =================================================================== --- trunk/src/hid_init.c (revision 4912) +++ trunk/src/hid_init.c (revision 4913) @@ -49,7 +49,7 @@ basename[strlen(basename) - 3] = 0; else if (strlen(basename) > 4 && strcasecmp(basename + strlen(basename) - 4, ".dll") == 0) basename[strlen(basename) - 4] = 0; - path = Concat(dirname, PCB_DIR_SEPARATOR_S, de->d_name, NULL); + path = pcb_concat(dirname, PCB_DIR_SEPARATOR_S, de->d_name, NULL); if (stat(path, &st) == 0 && ( /* mingw and win32 do not support S_IXGRP or S_IXOTH */ @@ -67,7 +67,7 @@ else { pcb_plugin_info_t *inf = plugin_find(basename); if (inf == NULL) { - symname = Concat("hid_", basename, "_init", NULL); + symname = pcb_concat("hid_", basename, "_init", NULL); if ((sym = dlsym(so, symname)) != NULL) { symv = (pcb_uninit_t (*)())pcb_cast_d2f(sym); uninit = symv(); @@ -100,18 +100,18 @@ gui = pcb_hid_nogui_get_hid(); #warning TODO: make this configurable - hid_load_dir(Concat(conf_core.rc.path.exec_prefix, PCB_DIR_SEPARATOR_S, "lib", + hid_load_dir(pcb_concat(conf_core.rc.path.exec_prefix, PCB_DIR_SEPARATOR_S, "lib", PCB_DIR_SEPARATOR_S, "pcb-rnd", PCB_DIR_SEPARATOR_S, "plugins", PCB_DIR_SEPARATOR_S, HOST, NULL)); - hid_load_dir(Concat(conf_core.rc.path.exec_prefix, PCB_DIR_SEPARATOR_S, "lib", + hid_load_dir(pcb_concat(conf_core.rc.path.exec_prefix, PCB_DIR_SEPARATOR_S, "lib", PCB_DIR_SEPARATOR_S, "pcb-rnd", PCB_DIR_SEPARATOR_S, "plugins", NULL)); /* conf_core.rc.path.home is set by the conf_core immediately on startup */ if (conf_core.rc.path.home != NULL) { - hid_load_dir(Concat(conf_core.rc.path.home, PCB_DIR_SEPARATOR_S, DOT_PCB_RND, PCB_DIR_SEPARATOR_S, "plugins", PCB_DIR_SEPARATOR_S, HOST, NULL)); - hid_load_dir(Concat(conf_core.rc.path.home, PCB_DIR_SEPARATOR_S, DOT_PCB_RND, PCB_DIR_SEPARATOR_S, "plugins", NULL)); + hid_load_dir(pcb_concat(conf_core.rc.path.home, PCB_DIR_SEPARATOR_S, DOT_PCB_RND, PCB_DIR_SEPARATOR_S, "plugins", PCB_DIR_SEPARATOR_S, HOST, NULL)); + hid_load_dir(pcb_concat(conf_core.rc.path.home, PCB_DIR_SEPARATOR_S, DOT_PCB_RND, PCB_DIR_SEPARATOR_S, "plugins", NULL)); } - hid_load_dir(Concat("plugins", PCB_DIR_SEPARATOR_S, HOST, NULL)); - hid_load_dir(Concat("plugins", NULL)); + hid_load_dir(pcb_concat("plugins", PCB_DIR_SEPARATOR_S, HOST, NULL)); + hid_load_dir(pcb_concat("plugins", NULL)); } void pcb_hid_uninit(void) Index: trunk/src/insert.c =================================================================== --- trunk/src/insert.c (revision 4912) +++ trunk/src/insert.c (revision 4913) @@ -96,8 +96,8 @@ if (gui->shift_is_pressed()) { pcb_attached_line_t myline; /* only force 45 degree for nearest point */ - if (Distance(Crosshair.X, Crosshair.Y, line->Point1.X, line->Point1.Y) < - Distance(Crosshair.X, Crosshair.Y, line->Point2.X, line->Point2.Y)) + if (pcb_distance(Crosshair.X, Crosshair.Y, line->Point1.X, line->Point1.Y) < + pcb_distance(Crosshair.X, Crosshair.Y, line->Point2.X, line->Point2.Y)) myline.Point1 = myline.Point2 = line->Point1; else myline.Point1 = myline.Point2 = line->Point2; Index: trunk/src/misc_util.c =================================================================== --- trunk/src/misc_util.c (revision 4912) +++ trunk/src/misc_util.c (revision 4913) @@ -37,10 +37,10 @@ #include "misc_util.h" #include "unit.h" -/* Distance() should be used so that there is only one +/* pcb_distance() should be used so that there is only one * place to deal with overflow/precision errors */ -double Distance(double x1, double y1, double x2, double y2) +double pcb_distance(double x1, double y1, double x2, double y2) { double delta_x = (x2 - x1); double delta_y = (y2 - y1); @@ -47,10 +47,10 @@ return sqrt(delta_x * delta_x + delta_y * delta_y); } -/* Distance2() should be used so that there is only one +/* pcb_distance2() should be used so that there is only one * place to deal with overflow/precision errors */ -double Distance2(double x1, double y1, double x2, double y2) +double pcb_distance2(double x1, double y1, double x2, double y2) { double delta_x = (x2 - x1); double delta_y = (y2 - y1); @@ -60,12 +60,12 @@ /* Get Value returns a numeric value passed from the string and sets the * pcb_bool variable absolute to false if it leads with a +/- character */ -double GetValue(const char *val, const char *units, pcb_bool * absolute, pcb_bool *success) +double pcb_get_value(const char *val, const char *units, pcb_bool * absolute, pcb_bool *success) { - return GetValueEx(val, units, absolute, NULL, "cmil", success); + return pcb_get_value_ex(val, units, absolute, NULL, "cmil", success); } -double GetValueEx(const char *val, const char *units, pcb_bool * absolute, pcb_unit_list_t extra_units, const char *default_unit, pcb_bool *success) +double pcb_get_value_ex(const char *val, const char *units, pcb_bool * absolute, pcb_unit_list_t extra_units, const char *default_unit, pcb_bool *success) { double value; int n = -1; @@ -149,7 +149,7 @@ return 0; } -char *Concat(const char *first, ...) +char *pcb_concat(const char *first, ...) { char *rv; int len; @@ -172,10 +172,10 @@ return rv; } -pcb_coord_t GetNum(char **s, const char *default_unit) +pcb_coord_t pcb_get_num(char **s, const char *default_unit) { /* Read value */ - pcb_coord_t ret_val = GetValueEx(*s, NULL, NULL, NULL, default_unit, NULL); + pcb_coord_t ret_val = pcb_get_value_ex(*s, NULL, NULL, NULL, default_unit, NULL); /* Advance pointer */ while (isalnum(**s) || **s == '.') (*s)++; @@ -187,7 +187,7 @@ * returns a pointer to the new 'duped' one or NULL if the old one * holds only white space characters */ -char *StripWhiteSpaceAndDup(const char *S) +char *pcb_strdup_strip_wspace(const char *S) { const char *p1, *p2; char *copy; Index: trunk/src/misc_util.h =================================================================== --- trunk/src/misc_util.h (revision 4912) +++ trunk/src/misc_util.h (revision 4913) @@ -31,8 +31,8 @@ #include "pcb_bool.h" -double Distance(double x1, double y1, double x2, double y2); -double Distance2(double x1, double y1, double x2, double y2); /* distance square */ +double pcb_distance(double x1, double y1, double x2, double y2); +double pcb_distance2(double x1, double y1, double x2, double y2); /* distance square */ enum pcb_unit_flags_e { UNIT_PERCENT = 1 }; @@ -42,14 +42,14 @@ enum pcb_unit_flags_e flags; } pcb_unit_list_t[]; -double GetValue(const char *, const char *, pcb_bool *, pcb_bool *success); -double GetValueEx(const char *, const char *, pcb_bool *, pcb_unit_list_t, const char *, pcb_bool *success); -pcb_coord_t GetNum(char **s, const char *default_unit); +double pcb_get_value(const char *, const char *, pcb_bool *, pcb_bool *success); +double pcb_get_value_ex(const char *, const char *, pcb_bool *, pcb_unit_list_t, const char *, pcb_bool *success); +pcb_coord_t pcb_get_num(char **s, const char *default_unit); -char *Concat(const char *, ...); /* end with NULL */ +char *pcb_concat(const char *, ...); /* end with NULL */ int pcb_mem_any_set(unsigned char *ptr, int bytes); -char *StripWhiteSpaceAndDup(const char *S); +char *pcb_strdup_strip_wspace(const char *S); #endif Index: trunk/src/obj_pinvia.c =================================================================== --- trunk/src/obj_pinvia.c (revision 4912) +++ trunk/src/obj_pinvia.c (revision 4913) @@ -92,7 +92,7 @@ if (!pcb_create_be_lenient) { VIA_LOOP(Data); { - if (Distance(X, Y, via->X, via->Y) <= via->DrillingHole / 2 + DrillingHole / 2) { + if (pcb_distance(X, Y, via->X, via->Y) <= via->DrillingHole / 2 + DrillingHole / 2) { pcb_message(PCB_MSG_DEFAULT, _("%m+Dropping via at %$mD because it's hole would overlap with the via " "at %$mD\n"), conf_core.editor.grid_unit->allow, X, Y, via->X, via->Y); return (NULL); /* don't allow via stacking */ Index: trunk/src/object_act.c =================================================================== --- trunk/src/object_act.c (revision 4912) +++ trunk/src/object_act.c (revision 4913) @@ -375,8 +375,8 @@ void *ptr1, *ptr2, *ptr3; int type; - ny = GetValue(y_str, units, &absolute1, NULL); - nx = GetValue(x_str, units, &absolute2, NULL); + ny = pcb_get_value(y_str, units, &absolute1, NULL); + nx = pcb_get_value(x_str, units, &absolute2, NULL); type = SearchScreen(x, y, MOVE_TYPES, &ptr1, &ptr2, &ptr3); if (type == PCB_TYPE_NONE) { @@ -475,7 +475,7 @@ const char *as = pcb_attrib_get(PCB, name); if (!as) return def; - return GetValue(as, NULL, NULL, NULL); + return pcb_get_value(as, NULL, NULL, NULL); } static int ActionElementList(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y) @@ -845,7 +845,7 @@ delta = function; flags = 0; } - value = 2 * GetValue(delta, units, &absolute, NULL); + value = 2 * pcb_get_value(delta, units, &absolute, NULL); SaveUndoSerialNumber(); ELEMENT_LOOP(PCB->Data); @@ -919,7 +919,7 @@ delta = function; flags = 0; } - value = 2 * GetValue(delta, units, &absolute, NULL); + value = 2 * pcb_get_value(delta, units, &absolute, NULL); SaveUndoSerialNumber(); ELEMENT_LOOP(PCB->Data); Index: trunk/src/paths.c =================================================================== --- trunk/src/paths.c (revision 4912) +++ trunk/src/paths.c (revision 4913) @@ -53,7 +53,7 @@ subst_to = conf_core.rc.path.home; subst_offs = 1; replace:; - /* avoid Concat() here to reduce dependencies for external tools */ + /* avoid pcb_concat() here to reduce dependencies for external tools */ l1 = strlen(subst_to); l2 = strlen((*in) + 1); *out = malloc(l1 + l2 + 4 + extra_room); Index: trunk/src/route_style.c =================================================================== --- trunk/src/route_style.c (revision 4912) +++ trunk/src/route_style.c (revision 4913) @@ -83,7 +83,7 @@ strcpy(routeStyle->name, Name); if (!isdigit((int) *++s)) goto error; - routeStyle->Thick = GetNum(&s, default_unit); + routeStyle->Thick = pcb_get_num(&s, default_unit); while (*s && isspace((int) *s)) s++; if (*s++ != ',') @@ -92,7 +92,7 @@ s++; if (!isdigit((int) *s)) goto error; - routeStyle->Diameter = GetNum(&s, default_unit); + routeStyle->Diameter = pcb_get_num(&s, default_unit); while (*s && isspace((int) *s)) s++; if (*s++ != ',') @@ -101,7 +101,7 @@ s++; if (!isdigit((int) *s)) goto error; - routeStyle->Hole = GetNum(&s, default_unit); + routeStyle->Hole = pcb_get_num(&s, default_unit); /* for backwards-compatibility, we use a 10-mil default * for styles which omit the clearance specification. */ if (*s != ',') @@ -112,7 +112,7 @@ s++; if (!isdigit((int) *s)) goto error; - routeStyle->Clearance = GetNum(&s, default_unit); + routeStyle->Clearance = pcb_get_num(&s, default_unit); while (*s && isspace((int) *s)) s++; } Index: trunk/src/search.c =================================================================== --- trunk/src/search.c (revision 4912) +++ trunk/src/search.c (revision 4913) @@ -223,7 +223,7 @@ return R_DIR_NOT_FOUND; if (PCB_FLAG_TEST(PCB_FLAG_VIA, line) ? - (Distance(line->Point1.X, line->Point1.Y, PosX, PosY) <= + (pcb_distance(line->Point1.X, line->Point1.Y, PosX, PosY) <= line->Thickness * 2 + SearchRadius) : IsPointOnLine(PosX, PosY, SearchRadius, line)) { *i->ptr1 = *i->ptr2 = *i->ptr3 = line; return R_DIR_CANCEL; @@ -362,7 +362,7 @@ return R_DIR_NOT_FOUND; /* some stupid code to check both points */ - d = Distance(PosX, PosY, line->Point1.X, line->Point1.Y); + d = pcb_distance(PosX, PosY, line->Point1.X, line->Point1.Y); if (d < i->least) { i->least = d; *i->Line = line; @@ -370,7 +370,7 @@ ret_val = R_DIR_FOUND_CONTINUE; } - d = Distance(PosX, PosY, line->Point2.X, line->Point2.Y); + d = pcb_distance(PosX, PosY, line->Point2.X, line->Point2.Y); if (d < i->least) { i->least = d; *i->Line = line; @@ -412,7 +412,7 @@ { POLYGONPOINT_LOOP(polygon); { - d = Distance(point->X, point->Y, PosX, PosY); + d = pcb_distance(point->X, point->Y, PosX, PosY); if (d < least) { least = d; *Polygon = polygon; @@ -535,7 +535,7 @@ if (IsPointInBox(X, Y, &b, Radius)) return pcb_true; } - else if (Distance(pin->X, pin->Y, X, Y) <= Radius + t) + else if (pcb_distance(pin->X, pin->Y, X, Y) <= Radius + t) return pcb_true; return pcb_false; } @@ -587,9 +587,9 @@ double D1, D2, L; /* Get length of segment */ - L = Distance(Line->Point1.X, Line->Point1.Y, Line->Point2.X, Line->Point2.Y); + L = pcb_distance(Line->Point1.X, Line->Point1.Y, Line->Point2.X, Line->Point2.Y); if (L < 0.1) - return Distance(X, Y, Line->Point1.X, Line->Point1.Y) < Radius + Line->Thickness / 2; + return pcb_distance(X, Y, Line->Point1.X, Line->Point1.Y) < Radius + Line->Thickness / 2; /* Get distance from (X1, Y1) to Q (on the line) */ D1 = ((double) (Y - Line->Point1.Y) * (Line->Point2.Y - Line->Point1.Y) @@ -806,7 +806,7 @@ /* so, pad.Point1.X = pad.Point1.Y = 0; */ /* rotate round (0, 0) so that Point2 coordinates be (r, 0) */ - r = Distance(0, 0, pad.Point2.X, pad.Point2.Y); + r = pcb_distance(0, 0, pad.Point2.X, pad.Point2.Y); if (r < .1) { Cos = 1; Sin = 0; @@ -833,13 +833,13 @@ if (Y <= t2) range = -X; else - return Radius > Distance(0, t2, X, Y); + return Radius > pcb_distance(0, t2, X, Y); } else if (X >= r) { if (Y <= t2) range = X - r; else - return Radius > Distance(r, t2, X, Y); + return Radius > pcb_distance(r, t2, X, Y); } else range = Y - t2; @@ -847,9 +847,9 @@ else { /*Rounded pad: even more simple */ if (X <= 0) - return (Radius + t2) > Distance(0, 0, X, Y); + return (Radius + t2) > pcb_distance(0, 0, X, Y); else if (X >= r) - return (Radius + t2) > Distance(r, 0, X, Y); + return (Radius + t2) > pcb_distance(r, 0, X, Y); else range = Y - t2; } @@ -871,17 +871,17 @@ if (X <= 0) { if (Y < 0) - return Radius > Distance(0, 0, X, Y); + return Radius > pcb_distance(0, 0, X, Y); else if (Y > height) - return Radius > Distance(0, height, X, Y); + return Radius > pcb_distance(0, height, X, Y); else range = -X; } else if (X >= width) { if (Y < 0) - return Radius > Distance(width, 0, X, Y); + return Radius > pcb_distance(width, 0, X, Y); else if (Y > height) - return Radius > Distance(width, height, X, Y); + return Radius > pcb_distance(width, height, X, Y); else range = X - width; } @@ -904,7 +904,7 @@ pcb_bool IsPointOnArc(pcb_coord_t X, pcb_coord_t Y, pcb_coord_t Radius, pcb_arc_t *Arc) { /* Calculate angle of point from arc center */ - double p_dist = Distance(X, Y, Arc->X, Arc->Y); + double p_dist = pcb_distance(X, Y, Arc->X, Arc->Y); double p_cos = (X - Arc->X) / p_dist; pcb_angle_t p_ang = acos(p_cos) * PCB_RAD_TO_DEG; pcb_angle_t ang1, ang2; @@ -934,17 +934,17 @@ ArcX = Arc->X + Arc->Width * cos((Arc->StartAngle + 180) / PCB_RAD_TO_DEG); ArcY = Arc->Y - Arc->Width * sin((Arc->StartAngle + 180) / PCB_RAD_TO_DEG); - if (Distance(X, Y, ArcX, ArcY) < Radius + Arc->Thickness / 2) + if (pcb_distance(X, Y, ArcX, ArcY) < Radius + Arc->Thickness / 2) return pcb_true; ArcX = Arc->X + Arc->Width * cos((Arc->StartAngle + Arc->Delta + 180) / PCB_RAD_TO_DEG); ArcY = Arc->Y - Arc->Width * sin((Arc->StartAngle + Arc->Delta + 180) / PCB_RAD_TO_DEG); - if (Distance(X, Y, ArcX, ArcY) < Radius + Arc->Thickness / 2) + if (pcb_distance(X, Y, ArcX, ArcY) < Radius + Arc->Thickness / 2) return pcb_true; return pcb_false; } /* If point is inside the arc range, just compare it to the arc */ - return fabs(Distance(X, Y, Arc->X, Arc->Y) - Arc->Width) < Radius + Arc->Thickness / 2; + return fabs(pcb_distance(X, Y, Arc->X, Arc->Y) - Arc->Width) < Radius + Arc->Thickness / 2; } /* --------------------------------------------------------------------------- Index: trunk/src/search.h =================================================================== --- trunk/src/search.h (revision 4912) +++ trunk/src/search.h (revision 4913) @@ -75,7 +75,7 @@ /* == the same but accept if any part of the object touches the box == */ #define POINT_IN_CIRCLE(x, y, cx, cy, r) \ - (Distance2(x, y, cx, cy) <= (double)(r) * (double)(r)) + (pcb_distance2(x, y, cx, cy) <= (double)(r) * (double)(r)) #define CIRCLE_TOUCHES_BOX(cx, cy, r, b) \ ( POINT_IN_BOX((cx)-(r),(cy),(b)) || POINT_IN_BOX((cx)+(r),(cy),(b)) || POINT_IN_BOX((cx),(cy)-(r),(b)) || POINT_IN_BOX((cx),(cy)+(r),(b)) \ Index: trunk/src_plugins/export_bboard/bboard.c =================================================================== --- trunk/src_plugins/export_bboard/bboard.c (revision 4912) +++ trunk/src_plugins/export_bboard/bboard.c (revision 4913) @@ -339,7 +339,7 @@ char *s; /* - s = Concat(pcblibdir, PCB_DIR_SEPARATOR_S, MODELBASE, PCB_DIR_SEPARATOR_S, + s = pcb_concat(pcblibdir, PCB_DIR_SEPARATOR_S, MODELBASE, PCB_DIR_SEPARATOR_S, BBOARDBASE, PCB_DIR_SEPARATOR_S, basename, (value && nested) ? PCB_DIR_SEPARATOR_S : "", (value && nested) ? basename : "", (value) ? "-" : "", (value) ? value : "", BBEXT, NULL); @@ -364,10 +364,10 @@ while (sscanf(s, "%30s%n", val, &ln) >= 1) { switch (n) { case 0: - xx = GetValueEx(val, NULL, NULL, NULL, "mm", NULL); + xx = pcb_get_value_ex(val, NULL, NULL, NULL, "mm", NULL); break; case 1: - yy = GetValueEx(val, NULL, NULL, NULL, "mm", NULL); + yy = pcb_get_value_ex(val, NULL, NULL, NULL, "mm", NULL); break; } s = s + ln; Index: trunk/src_plugins/export_openscad/scadcomp.c =================================================================== --- trunk/src_plugins/export_openscad/scadcomp.c (revision 4912) +++ trunk/src_plugins/export_openscad/scadcomp.c (revision 4913) @@ -242,13 +242,13 @@ while (sscanf(s, "%30s%n", val, &ln) >= 1) { switch (n) { case 0: - xx = GetValueEx(val, NULL, NULL, NULL, "mm", NULL); + xx = pcb_get_value_ex(val, NULL, NULL, NULL, "mm", NULL); break; case 1: - yy = GetValueEx(val, NULL, NULL, NULL, "mm", NULL); + yy = pcb_get_value_ex(val, NULL, NULL, NULL, "mm", NULL); break; case 2: - zz = GetValueEx(val, NULL, NULL, NULL, "mm", NULL); + zz = pcb_get_value_ex(val, NULL, NULL, NULL, "mm", NULL); break; } s = s + ln; @@ -397,19 +397,19 @@ while (sscanf(s, "%30s%n", val, &ln) >= 1) { switch (n) { case 0: - w = GetValueEx(val, NULL, NULL, NULL, "mm", NULL); + w = pcb_get_value_ex(val, NULL, NULL, NULL, "mm", NULL); break; case 1: - h = GetValueEx(val, NULL, NULL, NULL, "mm", NULL); + h = pcb_get_value_ex(val, NULL, NULL, NULL, "mm", NULL); break; case 2: - t = GetValueEx(val, NULL, NULL, NULL, "mm", NULL); + t = pcb_get_value_ex(val, NULL, NULL, NULL, "mm", NULL); break; case 3: - ox = GetValueEx(val, NULL, NULL, NULL, "mm", NULL); + ox = pcb_get_value_ex(val, NULL, NULL, NULL, "mm", NULL); break; case 4: - oy = GetValueEx(val, NULL, NULL, NULL, "mm", NULL); + oy = pcb_get_value_ex(val, NULL, NULL, NULL, "mm", NULL); break; } s = s + ln; Index: trunk/src_plugins/export_png/png.c =================================================================== --- trunk/src_plugins/export_png/png.c (revision 4912) +++ trunk/src_plugins/export_png/png.c (revision 4913) @@ -424,7 +424,7 @@ extra_units[n].scale = scale; if (str == NULL) return; - bloat = GetValueEx(str, NULL, NULL, extra_units, "", NULL); + bloat = pcb_get_value_ex(str, NULL, NULL, extra_units, "", NULL); } void png_hid_export_to_file(FILE * the_file, pcb_hid_attr_val_t * options) Index: trunk/src_plugins/fp_fs/fp_fs.c =================================================================== --- trunk/src_plugins/fp_fs/fp_fs.c (revision 4912) +++ trunk/src_plugins/fp_fs/fp_fs.c (revision 4913) @@ -93,7 +93,7 @@ l->children++; e = fp_append_entry(l->menu, name, type, tags); -/* Avoid using Concat() - would be a new dependency for gsch2pcb-rnd */ +/* Avoid using pcb_concat() - would be a new dependency for gsch2pcb-rnd */ { int sl = strlen(subdir); int nl = strlen(name); Index: trunk/src_plugins/gpmi/pcb-gpmi/gpmi_plugin/gpmi_plugin.c =================================================================== --- trunk/src_plugins/gpmi/pcb-gpmi/gpmi_plugin/gpmi_plugin.c (revision 4912) +++ trunk/src_plugins/gpmi/pcb-gpmi/gpmi_plugin/gpmi_plugin.c (revision 4913) @@ -142,16 +142,16 @@ const char *home; void **gpmi_asm_scriptname; - libdirg = resolve_path_inplace(Concat(PCBLIBDIR, PCB_DIR_SEPARATOR_S "plugins", NULL), 0); - libdirh = resolve_path_inplace(Concat(PCBLIBDIR, PCB_DIR_SEPARATOR_S "plugins" PCB_DIR_SEPARATOR_S, HOST, NULL), 0); - wdirh = resolve_path_inplace(Concat ("plugins" PCB_DIR_SEPARATOR_S, HOST, NULL), 0); - wdir = Concat("plugins", NULL); + libdirg = resolve_path_inplace(pcb_concat(PCBLIBDIR, PCB_DIR_SEPARATOR_S "plugins", NULL), 0); + libdirh = resolve_path_inplace(pcb_concat(PCBLIBDIR, PCB_DIR_SEPARATOR_S "plugins" PCB_DIR_SEPARATOR_S, HOST, NULL), 0); + wdirh = resolve_path_inplace(pcb_concat("plugins" PCB_DIR_SEPARATOR_S, HOST, NULL), 0); + wdir = pcb_concat("plugins", NULL); home = getenv ("PCB_RND_GPMI_HOME"); if (home == NULL) home = conf_core.rc.path.home; - hdirh = resolve_path_inplace(Concat(home, PCB_DIR_SEPARATOR_S ".pcb" PCB_DIR_SEPARATOR_S "plugins" PCB_DIR_SEPARATOR_S, HOST, NULL), 0); + hdirh = resolve_path_inplace(pcb_concat(home, PCB_DIR_SEPARATOR_S ".pcb" PCB_DIR_SEPARATOR_S "plugins" PCB_DIR_SEPARATOR_S, HOST, NULL), 0); fprintf(stderr, "gpmi dirs: lg=%s lh=%s wh=%s w=%s hh=%s\n", libdirg, libdirh, wdirh, wdir, hdirh); @@ -188,7 +188,7 @@ hid_gpmi_load_dir(libdirh, 0); hid_gpmi_load_dir(libdirg, 0); - dir = Concat(PCBLIBDIR, PCB_DIR_SEPARATOR_S "plugins", NULL); + dir = pcb_concat(PCBLIBDIR, PCB_DIR_SEPARATOR_S "plugins", NULL); hid_gpmi_load_dir(dir, 1); free(dir); @@ -195,7 +195,7 @@ if (home != NULL) { hid_gpmi_load_dir (hdirh, 0); - dir = resolve_path_inplace(Concat(home, PCB_DIR_SEPARATOR_S ".pcb" PCB_DIR_SEPARATOR_S "plugins", NULL), 0); + dir = resolve_path_inplace(pcb_concat(home, PCB_DIR_SEPARATOR_S ".pcb" PCB_DIR_SEPARATOR_S "plugins", NULL), 0); hid_gpmi_load_dir(dir, 1); free(dir); } Index: trunk/src_plugins/gpmi/pcb-gpmi/gpmi_plugin/manage_scripts.c =================================================================== --- trunk/src_plugins/gpmi/pcb-gpmi/gpmi_plugin/manage_scripts.c (revision 4912) +++ trunk/src_plugins/gpmi/pcb-gpmi/gpmi_plugin/manage_scripts.c (revision 4913) @@ -24,7 +24,7 @@ #define attr_make_label_str(attr, name1, name2, help_) \ do { \ char *__names__; \ - __names__ = Concat(name1, name2, NULL); \ + __names__ = pcb_concat(name1, name2, NULL); \ attr_make_label(attr, __names__, help_); \ } while(0) @@ -59,7 +59,7 @@ else basename++; - scrl[n] = Concat(basename, "\t", i->module_name, NULL); + scrl[n] = pcb_concat(basename, "\t", i->module_name, NULL); } scrl[n] = NULL; @@ -219,7 +219,7 @@ r2 = gpmi_hid_script_unload(i); if (r1 || r2) { char *msg; - msg = Concat("Error:", + msg = pcb_concat("Error:", (r1 ? "couldnt't remove the script from the config file;" : ""), (r2 ? "couldnt't unload the script;" : ""), "\n" CONSULT "\n", NULL); Index: trunk/src_plugins/gpmi/pcb-gpmi/gpmi_plugin/scripts.c =================================================================== --- trunk/src_plugins/gpmi/pcb-gpmi/gpmi_plugin/scripts.c (revision 4912) +++ trunk/src_plugins/gpmi/pcb-gpmi/gpmi_plugin/scripts.c (revision 4913) @@ -234,7 +234,7 @@ char *cfn; conf_dir = dir; - cfn = Concat(dir, PCB_DIR_SEPARATOR_S, CONFNAME, NULL); + cfn = pcb_concat(dir, PCB_DIR_SEPARATOR_S, CONFNAME, NULL); #ifdef CONFIG_DEBUG fprintf(stderr, "pcb-gpmi: opening config: %s\n", cfn); #endif @@ -318,7 +318,7 @@ pcb_message(PCB_MSG_DEFAULT, "gpmi_hid_script_remove(): can't remove script from configs, can't open %s for read.\n", i->conffile_name); return -1; } - tmpfn = Concat(i->conffile_name, ".tmp", NULL); + tmpfn = pcb_concat(i->conffile_name, ".tmp", NULL); fout = fopen(tmpfn, "w"); if (fout == NULL) { pcb_message(PCB_MSG_DEFAULT, "gpmi_hid_script_remove(): can't remove script from configs, can't create %s.\n", tmpfn); @@ -359,18 +359,18 @@ home = conf_core.rc.path.home; if (conf_core.rc.path.home != NULL) { - fn = Concat(home, PCB_DIR_SEPARATOR_S ".pcb", NULL); + fn = pcb_concat(home, PCB_DIR_SEPARATOR_S ".pcb", NULL); pcb_mkdir(fn, 0755); free(fn); - fn = Concat(home, PCB_DIR_SEPARATOR_S ".pcb" PCB_DIR_SEPARATOR_S "plugins", NULL); + fn = pcb_concat(home, PCB_DIR_SEPARATOR_S ".pcb" PCB_DIR_SEPARATOR_S "plugins", NULL); pcb_mkdir(fn, 0755); free(fn); - fn = Concat(home, PCB_DIR_SEPARATOR_S ".pcb" PCB_DIR_SEPARATOR_S "plugins" PCB_DIR_SEPARATOR_S, CONFNAME, NULL); + fn = pcb_concat(home, PCB_DIR_SEPARATOR_S ".pcb" PCB_DIR_SEPARATOR_S "plugins" PCB_DIR_SEPARATOR_S, CONFNAME, NULL); } else - fn = Concat("plugins" PCB_DIR_SEPARATOR_S, CONFNAME, NULL); + fn = pcb_concat("plugins" PCB_DIR_SEPARATOR_S, CONFNAME, NULL); f = fopen(fn, "a"); if (f == NULL) { Index: trunk/src_plugins/hid_gtk/ghid-main-menu.c =================================================================== --- trunk/src_plugins/hid_gtk/ghid-main-menu.c (revision 4912) +++ trunk/src_plugins/hid_gtk/ghid-main-menu.c (revision 4913) @@ -192,7 +192,7 @@ char *acc = NULL, *s; if (n_keydesc != NULL) acc = pcb_hid_cfg_keys_gen_accel(&ghid_keymap, n_keydesc, -1, "\nhotkey: "); - s = Concat((tip == NULL ? "" : tip), "\nhotkey: ", (acc == NULL ? "" : acc), NULL); + s = pcb_concat((tip == NULL ? "" : tip), "\nhotkey: ", (acc == NULL ? "" : acc), NULL); gtk_widget_set_tooltip_text(item, s); free(s); } Index: trunk/src_plugins/hid_gtk/ghid-search.c =================================================================== --- trunk/src_plugins/hid_gtk/ghid-search.c (revision 4912) +++ trunk/src_plugins/hid_gtk/ghid-search.c (revision 4913) @@ -642,7 +642,7 @@ case RIGHT_COORD: { pcb_bool succ; - double d = GetValueEx(right, NULL, NULL, NULL, "mm", &succ); + double d = pcb_get_value_ex(right, NULL, NULL, NULL, "mm", &succ); if (succ) ghid_coord_entry_set_value(GHID_COORD_ENTRY(expr_wizard_dlg.right_coord), d); break; Index: trunk/src_plugins/hid_gtk/gtkhid-main.c =================================================================== --- trunk/src_plugins/hid_gtk/gtkhid-main.c (revision 4912) +++ trunk/src_plugins/hid_gtk/gtkhid-main.c (revision 4913) @@ -1594,10 +1594,10 @@ else PCB_AFAIL(cursor); - dx = GetValueEx(argv[1], argv[3], NULL, extra_units_x, "", NULL); + dx = pcb_get_value_ex(argv[1], argv[3], NULL, extra_units_x, "", NULL); if (conf_core.editor.view.flip_x) dx = -dx; - dy = GetValueEx(argv[2], argv[3], NULL, extra_units_y, "", NULL); + dy = pcb_get_value_ex(argv[2], argv[3], NULL, extra_units_y, "", NULL); if (!conf_core.editor.view.flip_y) dy = -dy; Index: trunk/src_plugins/hid_gtk/gui-dialog-print.c =================================================================== --- trunk/src_plugins/hid_gtk/gui-dialog-print.c (revision 4912) +++ trunk/src_plugins/hid_gtk/gui-dialog-print.c (revision 4913) @@ -56,7 +56,7 @@ static void coordentry_changed_cb(GtkEntry * entry, pcb_coord_t * res) { const gchar *s = gtk_entry_get_text(entry); - *res = GetValue(s, NULL, NULL, NULL); + *res = pcb_get_value(s, NULL, NULL, NULL); } static void dblspinner_changed_cb(GtkSpinButton * spin_button, gpointer data) Index: trunk/src_plugins/hid_gtk/gui-misc.c =================================================================== --- trunk/src_plugins/hid_gtk/gui-misc.c (revision 4912) +++ trunk/src_plugins/hid_gtk/gui-misc.c (revision 4913) @@ -399,7 +399,7 @@ if (Marked.status) { pcb_coord_t dx = Crosshair.X - Marked.X; pcb_coord_t dy = Crosshair.Y - Marked.Y; - pcb_coord_t r = Distance(Crosshair.X, Crosshair.Y, Marked.X, Marked.Y); + pcb_coord_t r = pcb_distance(Crosshair.X, Crosshair.Y, Marked.X, Marked.Y); double a = atan2(dy, dx) * PCB_RAD_TO_DEG; Index: trunk/src_plugins/hid_lesstif/dialogs.c =================================================================== --- trunk/src_plugins/hid_lesstif/dialogs.c (revision 4912) +++ trunk/src_plugins/hid_lesstif/dialogs.c (revision 4913) @@ -759,7 +759,7 @@ break; case HID_Coord: cp = XmTextGetString(wl[i]); - results[i].coord_value = GetValue(cp, NULL, NULL, NULL); + results[i].coord_value = pcb_get_value(cp, NULL, NULL, NULL); break; case HID_Real: cp = XmTextGetString(wl[i]); @@ -1037,7 +1037,7 @@ char *buf = XmTextGetString(w); if (!pcbu) return strtol(buf, NULL, 0); - return GetValueEx(buf, NULL, NULL, NULL, conf_core.editor.grid_unit->suffix, NULL); + return pcb_get_value_ex(buf, NULL, NULL, NULL, conf_core.editor.grid_unit->suffix, NULL); } static void sz_val2str(Widget w, pcb_coord_t u, int pcbu) Index: trunk/src_plugins/hid_lesstif/main.c =================================================================== --- trunk/src_plugins/hid_lesstif/main.c (revision 4912) +++ trunk/src_plugins/hid_lesstif/main.c (revision 4913) @@ -856,10 +856,10 @@ else PCB_AFAIL(cursor); - dx = GetValueEx(argv[1], argv[3], NULL, extra_units_x, "mil", NULL); + dx = pcb_get_value_ex(argv[1], argv[3], NULL, extra_units_x, "mil", NULL); if (conf_core.editor.view.flip_x) dx = -dx; - dy = GetValueEx(argv[2], argv[3], NULL, extra_units_y, "mil", NULL); + dy = pcb_get_value_ex(argv[2], argv[3], NULL, extra_units_y, "mil", NULL); if (!conf_core.editor.view.flip_y) dy = -dy; @@ -1902,7 +1902,7 @@ pcb_cvt_string_to_coord(Display * d, XrmValue * args, Cardinal * num_args, XrmValue * from, XrmValue * to, XtPointer * data) { static pcb_coord_t rv; - rv = GetValue((char *) from->addr, NULL, NULL, NULL); + rv = pcb_get_value((char *) from->addr, NULL, NULL, NULL); if (to->addr) *(pcb_coord_t *) to->addr = rv; else @@ -2257,7 +2257,7 @@ buf = pcb_strdup_printf("%m+%+.*mS, %+.*mS", UUNIT, prec, dx, prec, dy); else { pcb_angle_t angle = atan2(dy, -dx) * 180 / M_PI; - pcb_coord_t dist = Distance(0, 0, dx, dy); + pcb_coord_t dist = pcb_distance(0, 0, dx, dy); buf = pcb_strdup_printf("%m+%+.*mS, %+.*mS (%.*mS, %.2f\260)", UUNIT, prec, dx, prec, dy, prec, dist, angle); } Index: trunk/src_plugins/hid_lesstif/styles.c =================================================================== --- trunk/src_plugins/hid_lesstif/styles.c (revision 4912) +++ trunk/src_plugins/hid_lesstif/styles.c (revision 4913) @@ -143,7 +143,7 @@ if (local_update) return; s = XmTextGetString(w); - GetValueEx(s, NULL, NULL, NULL, unit->suffix, NULL); + pcb_get_value_ex(s, NULL, NULL, NULL, unit->suffix, NULL); switch (i) { case SSthick: conf_setf(CFR_DESIGN, "design/line_thickness", -1, "%s %s", s, unit->suffix); Index: trunk/src_plugins/import_sch/import_sch.c =================================================================== --- trunk/src_plugins/import_sch/import_sch.c (revision 4912) +++ trunk/src_plugins/import_sch/import_sch.c (revision 4913) @@ -226,8 +226,8 @@ } } else if (ys) { - x = GetValue(xs, units, NULL, NULL); - y = GetValue(ys, units, NULL, NULL); + x = pcb_get_value(xs, units, NULL, NULL); + y = pcb_get_value(ys, units, NULL, NULL); } else { pcb_message(PCB_MSG_DEFAULT, _("Bad syntax for Import(setnewpoint)")); @@ -399,9 +399,9 @@ cmd[0] = conf_import_sch.plugins.import_sch.make_program; cmd[1] = "-s"; - cmd[2] = Concat("PCB=", PCB->Filename, NULL); + cmd[2] = pcb_concat("PCB=", PCB->Filename, NULL); cmd[3] = srclist; - cmd[4] = Concat("OUT=", tmpfile, NULL); + cmd[4] = pcb_concat("OUT=", tmpfile, NULL); i = 5; if (user_makefile) { cmd[i++] = "-f"; Index: trunk/src_plugins/io_kicad/read.c =================================================================== --- trunk/src_plugins/io_kicad/read.c (revision 4912) +++ trunk/src_plugins/io_kicad/read.c (revision 4913) @@ -605,7 +605,7 @@ } required = BV(0) | BV(1) | BV(2) | BV(3); /* | BV(4); not needed for circles */ if ((tally & required) == required) { /* need start, end, layer, thickness at a minimum */ - width = height = Distance(centreX, centreY, endX, endY); /* calculate radius of arc */ + width = height = pcb_distance(centreX, centreY, endX, endY); /* calculate radius of arc */ if (width < 1) { /* degenerate case */ startAngle = 0; } else { @@ -1770,7 +1770,7 @@ required = BV(0) | BV(6) | BV(8); if (((featureTally & required) == required) && newModule != NULL) { /* need start, layer, thickness at a minimum */ - width = height = Distance(centreX, centreY, endX, endY); /* calculate radius of arc */ + width = height = pcb_distance(centreX, centreY, endX, endY); /* calculate radius of arc */ if (width < 1) { /* degenerate case */ startAngle = 0; } else { Index: trunk/src_plugins/io_lihata/read.c =================================================================== --- trunk/src_plugins/io_lihata/read.c (revision 4912) +++ trunk/src_plugins/io_lihata/read.c (revision 4913) @@ -91,7 +91,7 @@ if ((nd == NULL) || (nd->type != LHT_TEXT)) return -1; - tmp = GetValueEx(nd->data.text.value, NULL, NULL, NULL, NULL, &success); + tmp = pcb_get_value_ex(nd->data.text.value, NULL, NULL, NULL, NULL, &success); if (!success) { pcb_message(PCB_MSG_ERROR, "#LHT1 Invalid coord value: '%s'\n", nd->data.text.value); return -1; @@ -112,7 +112,7 @@ return -1; } - tmp = GetValueEx(nd->data.text.value, NULL, NULL, NULL, NULL, &success); + tmp = pcb_get_value_ex(nd->data.text.value, NULL, NULL, NULL, NULL, &success); if (!success) { pcb_message(PCB_MSG_ERROR, "#LHT3 Invalid angle value: '%s'\n", nd->data.text.value); return -1; Index: trunk/src_plugins/io_lihata/write.c =================================================================== --- trunk/src_plugins/io_lihata/write.c (revision 4912) +++ trunk/src_plugins/io_lihata/write.c (revision 4913) @@ -733,8 +733,8 @@ /* fprintf(stderr, "SMART d='%s' m='%s'\n", ondisk_value, inmem_node->data.text.value);*/ - v1 = GetValueEx(ondisk_value, NULL, NULL, NULL, NULL, &success1); - v2 = GetValueEx(inmem_node->data.text.value, NULL, NULL, NULL, NULL, &success2); + v1 = pcb_get_value_ex(ondisk_value, NULL, NULL, NULL, NULL, &success1); + v2 = pcb_get_value_ex(inmem_node->data.text.value, NULL, NULL, NULL, NULL, &success2); /* pcb_fprintf(stderr, " %d %d | %mm %mm\n", success1, success2, v1, v2);*/ if (success1 && success2) { /* smart: if values are the same, keep the on-disk version */ Index: trunk/src_plugins/jostle/jostle.c =================================================================== --- trunk/src_plugins/jostle/jostle.c (revision 4912) +++ trunk/src_plugins/jostle/jostle.c (revision 4913) @@ -503,7 +503,7 @@ if (argc == 2) { pcb_bool succ; - value = GetValue(ARG(0), ARG(1), &rel, &succ); + value = pcb_get_value(ARG(0), ARG(1), &rel, &succ); if (!succ) { pcb_message(PCB_MSG_ERROR, "Failed to convert size\n"); return -1; Index: trunk/src_plugins/propedit/propsel.c =================================================================== --- trunk/src_plugins/propedit/propsel.c (revision 4912) +++ trunk/src_plugins/propedit/propsel.c (revision 4913) @@ -441,7 +441,7 @@ ctx.is_attr = (prop[0] == 'a'); ctx.name = prop; ctx.value = value; - ctx.c = GetValueEx(value, NULL, &ctx.c_absolute, NULL, NULL, &ctx.c_valid); + ctx.c = pcb_get_value_ex(value, NULL, &ctx.c_absolute, NULL, NULL, &ctx.c_valid); ctx.d = strtod(value, &end); ctx.d_valid = (*end == '\0'); start = value; Index: trunk/src_plugins/puller/puller.c =================================================================== --- trunk/src_plugins/puller/puller.c (revision 4912) +++ trunk/src_plugins/puller/puller.c (revision 4913) @@ -96,7 +96,7 @@ static int within(int x1, int y1, int x2, int y2, int r) { - return Distance(x1, y1, x2, y2) <= r / 2; + return pcb_distance(x1, y1, x2, y2) <= r / 2; } static int arc_endpoint_is(pcb_arc_t *a, int angle, int x, int y) @@ -128,7 +128,7 @@ #if TRACE1 pcb_printf(" - arc endpoint %#mD\n", ax, ay); #endif - arc_dist = Distance(ax, ay, x, y); + arc_dist = pcb_distance(ax, ay, x, y); if (arc_exact) return arc_dist < 2; return arc_dist < a->Thickness / 2; @@ -244,7 +244,7 @@ /* distance between a line and a point */ static double dist_lp(int x1, int y1, int x2, int y2, int px, int py) { - double den = Distance(x1, y1, x2, y2); + double den = pcb_distance(x1, y1, x2, y2); double rv = (fabs(((double) x2 - x1) * ((double) y1 - py) - ((double) x1 - px) * ((double) y2 - y1)) / den); @@ -259,12 +259,12 @@ { double d; if (dot2d(x1, y1, x2, y2, px, py) < 0) - return Distance(x1, y1, px, py); + return pcb_distance(x1, y1, px, py); if (dot2d(x2, y2, x1, y1, px, py) < 0) - return Distance(x2, y2, px, py); + return pcb_distance(x2, y2, px, py); d = (fabs(((double) x2 - x1) * ((double) y1 - py) - ((double) x1 - px) * ((double) y2 - y1)) - / Distance(x1, y1, x2, y2)); + / pcb_distance(x1, y1, x2, y2)); return d; } @@ -282,8 +282,8 @@ #if TRACE1 pcb_printf("line %#mD .. %#mD\n", l->Point1.X, l->Point1.Y, l->Point2.X, l->Point2.Y); #endif - d1 = Distance(l->Point1.X, l->Point1.Y, x, y); - d2 = Distance(l->Point2.X, l->Point2.Y, x, y); + d1 = pcb_distance(l->Point1.X, l->Point1.Y, x, y); + d2 = pcb_distance(l->Point2.X, l->Point2.Y, x, y); if ((d1 < 2 || d2 < 2) && !line_exact) { line_exact = 1; the_line = 0; @@ -437,7 +437,7 @@ arc_angle = the_arc->StartAngle + the_arc->Delta - 90; base_angle = r2d(atan2(ey - cy, cx - ex)); - tangent = r2d(acos(the_arc->Width / Distance(cx, cy, ex, ey))); + tangent = r2d(acos(the_arc->Width / pcb_distance(cx, cy, ex, ey))); #if TRACE1 line_angle = r2d(atan2(ey - y, x - ex)); @@ -737,7 +737,7 @@ if (PCB_FLAG_TEST(PCB_FLAG_SQUARE, pin)) inside_p = (x >= pin->X - t && x <= pin->X + t && y >= pin->Y - t && y <= pin->Y + t); else - inside_p = (Distance(pin->X, pin->Y, x, y) <= t); + inside_p = (pcb_distance(pin->X, pin->Y, x, y) <= t); if (inside_p) { e->in_pin = 1; @@ -819,7 +819,7 @@ && y >= pad->Point1.Y - t && y <= pad->Point1.Y + t); } if (!inside_p) { - if (Distance(pad->Point1.X, pad->Point1.Y, x, y) <= t || Distance(pad->Point2.X, pad->Point2.Y, x, y) <= t) + if (pcb_distance(pad->Point1.X, pad->Point1.Y, x, y) <= t || pcb_distance(pad->Point2.X, pad->Point2.Y, x, y) <= t) inside_p = 1; } } @@ -1291,7 +1291,7 @@ r = t + thickness; /* See if the point is inside our start arc. */ - d = Distance(scx, scy, x, y); + d = pcb_distance(scx, scy, x, y); #if TRACE1 pcb_printf("%f = dist #mD to %#mD\n", d, scx, scy, x, y); pcb_printf("sr %#mS r %f d %f\n", sr, r, d); @@ -1389,9 +1389,9 @@ printf("%f * %f < %f * %f ?\n", a, se_sign, best_angle, se_sign); #endif if (a * se_sign == best_angle * se_sign) { - double old_d = Distance(start_line->Point1.X, start_line->Point1.Y, + double old_d = pcb_distance(start_line->Point1.X, start_line->Point1.Y, fx, fy); - double new_d = Distance(start_line->Point1.X, start_line->Point1.Y, + double new_d = pcb_distance(start_line->Point1.X, start_line->Point1.Y, x, y); if (new_d > old_d) { best_angle = a; @@ -1921,7 +1921,7 @@ abort(); } - end_dist = Distance(end_line->Point1.X, end_line->Point1.Y, end_line->Point2.X, end_line->Point2.Y); + end_dist = pcb_distance(end_line->Point1.X, end_line->Point1.Y, end_line->Point2.X, end_line->Point2.Y); start_pinpad = start_extra->start.pin; end_pinpad = start_extra->end.pin; @@ -2039,7 +2039,7 @@ pcb_printf("obstacle at %#mD angle %d = arc starts at %#mD\n", fx, fy, (int) r2d(oa), (int) ox, (int) oy); #endif - if (Distance(ox, oy, end_line->Point2.X, end_line->Point2.Y) + if (pcb_distance(ox, oy, end_line->Point2.X, end_line->Point2.Y) < fr * SIN1D) { /* Pretend it doesn't exist. */ fx = ex; Index: trunk/src_plugins/report/report.c =================================================================== --- trunk/src_plugins/report/report.c (revision 4912) +++ trunk/src_plugins/report/report.c (revision 4913) @@ -343,7 +343,7 @@ } } END_LOOP; - len = Distance(Pad->Point1.X, Pad->Point1.Y, Pad->Point2.X, Pad->Point2.Y); + len = pcb_distance(Pad->Point1.X, Pad->Point1.Y, Pad->Point2.X, Pad->Point2.Y); report = pcb_strdup_printf("%m+PAD ID# %ld; Flags:%s\n" "FirstPoint(X,Y) = %$mD; ID = %ld.\n" "SecondPoint(X,Y) = %$mD; ID = %ld.\n" @@ -667,7 +667,7 @@ char *n; if (ename && pname) { - n = Concat(ename, "-", pname, NULL); + n = pcb_concat(ename, "-", pname, NULL); for (ni = 0; ni < PCB->NetlistLib[NETLIST_EDITED].MenuN; ni++) for (nei = 0; nei < PCB->NetlistLib[NETLIST_EDITED].Menu[ni].EntryN; nei++) { if (strcmp(PCB->NetlistLib[NETLIST_EDITED].Menu[ni].Entry[nei].ListEntry, n) == 0) { @@ -688,7 +688,7 @@ char *n; if (ename && pname) { - n = Concat(ename, "-", pname, NULL); + n = pcb_concat(ename, "-", pname, NULL); for (ni = 0; ni < PCB->NetlistLib[NETLIST_EDITED].MenuN; ni++) for (nei = 0; nei < PCB->NetlistLib[NETLIST_EDITED].Menu[ni].EntryN; nei++) { if (strcmp(PCB->NetlistLib[NETLIST_EDITED].Menu[ni].Entry[nei].ListEntry, n) == 0) { Index: trunk/src_plugins/shand_cmd/command.c =================================================================== --- trunk/src_plugins/shand_cmd/command.c (revision 4912) +++ trunk/src_plugins/shand_cmd/command.c (revision 4913) @@ -276,7 +276,7 @@ } if (PCB->Netlistname) free(PCB->Netlistname); - PCB->Netlistname = StripWhiteSpaceAndDup(filename); + PCB->Netlistname = pcb_strdup_strip_wspace(filename); return (0); } Index: trunk/tests/pcb-printf/prcli.c =================================================================== --- trunk/tests/pcb-printf/prcli.c (revision 4912) +++ trunk/tests/pcb-printf/prcli.c (revision 4913) @@ -13,7 +13,7 @@ for(n = 2; n < argc; n++) { pcb_bool success; - double val = GetValueEx(argv[n], NULL, NULL, NULL, "", &success); + double val = pcb_get_value_ex(argv[n], NULL, NULL, NULL, "", &success); if (!success) { fprintf(stderr, "Unable to convert '%s' to coord\n", argv[n]); return 1;