Index: excitation.c =================================================================== --- excitation.c (revision 31006) +++ excitation.c (revision 31007) @@ -192,7 +192,7 @@ if (!to_hz(rnd_attribute_get(&PCB->Attributes, AEPREFIX "gaussian::fc"), &fc)) rnd_message(RND_MSG_ERROR, "Gauss excitation: unable to parse frequency gaussian::fc\n"); - return pcb_strdup_printf("FDTD = SetGaussExcite(FDTD, %f, %f);", fc, f0); + return rnd_strdup_printf("FDTD = SetGaussExcite(FDTD, %f, %f);", fc, f0); } static void exc_gaus_ser(int idx, int save) @@ -227,7 +227,7 @@ if (!to_hz(rnd_attribute_get(&PCB->Attributes, AEPREFIX "sinusoidal::f0"), &f0)) rnd_message(RND_MSG_ERROR, "Sinus excitation: unable to parse frequency sinusoidal::f0\n"); - return pcb_strdup_printf("FDTD = SetSinusExcite(FDTD, %f);", f0); + return rnd_strdup_printf("FDTD = SetSinusExcite(FDTD, %f);", f0); } static void exc_sin_ser(int idx, int save) @@ -267,7 +267,7 @@ if (!to_hz(rnd_attribute_get(&PCB->Attributes, AEPREFIX "custom::f0"), &f0)) rnd_message(RND_MSG_ERROR, "Custom excitation: unable to parse frequency custom::f0\n"); - return pcb_strdup_printf( + return rnd_strdup_printf( "FDTD = SetCustomExcite(FDTD, %f, %s)", f0, rnd_attribute_get(&PCB->Attributes, AEPREFIX "custom::func") @@ -492,7 +492,7 @@ RND_PCB_ACT_CONVARG(start+0, FGW_STR, OpenemsExcitation, key = argv[start+0].val.str); RND_PCB_ACT_CONVARG(start+1, FGW_STR, OpenemsExcitation, val = argv[start+1].val.str); - attrkey = pcb_strdup_printf(AEPREFIX "%s::%s", a1, key); + attrkey = rnd_strdup_printf(AEPREFIX "%s::%s", a1, key); rnd_attribute_put(&PCB->Attributes, attrkey, val); free(attrkey); @@ -512,7 +512,7 @@ RND_PCB_ACT_CONVARG(start+0, FGW_STR, OpenemsExcitation, key = argv[start+0].val.str); - attrkey = pcb_strdup_printf(AEPREFIX "%s::%s", a1, key); + attrkey = rnd_strdup_printf(AEPREFIX "%s::%s", a1, key); res->type = FGW_STR; res->val.cstr = rnd_attribute_get(&PCB->Attributes, attrkey); free(attrkey); Index: export_openems.c =================================================================== --- export_openems.c (revision 31006) +++ export_openems.c (revision 31007) @@ -207,8 +207,8 @@ fprintf(ctx->f, "base_priority=%ld;\n", ctx->options[HA_base_prio].lng); fprintf(ctx->f, "\n"); fprintf(ctx->f, "%% offset on the whole layout to locate it relative to the simulation origin\n"); - pcb_fprintf(ctx->f, "offset.x = %mm;\n", -ctx->ox); - pcb_fprintf(ctx->f, "offset.y = %mm;\n", ctx->oy); + rnd_fprintf(ctx->f, "offset.x = %mm;\n", -ctx->ox); + rnd_fprintf(ctx->f, "offset.y = %mm;\n", ctx->oy); fprintf(ctx->f, "offset.z = 0;\n"); fprintf(ctx->f, "\n"); @@ -251,9 +251,9 @@ fmt = (grp->ltype & PCB_LYT_COPPER) ? cop_fmt : subs_fmt; assert(opt >= 0); if (fmt == NULL) - pcb_fprintf(ctx->f, "%s", ctx->options[opt].str); + rnd_fprintf(ctx->f, "%s", ctx->options[opt].str); else - pcb_fprintf(ctx->f, fmt, ctx->options[opt].crd); + rnd_fprintf(ctx->f, fmt, ctx->options[opt].crd); } static void openems_write_layers(wctx_t *ctx) @@ -339,15 +339,15 @@ long n; pcb_poly_t *p = pcb_topoly_conn(ctx->pcb, out1, PCB_TOPOLY_KEEP_ORIG | PCB_TOPOLY_FLOATING); for(n = 0; n < p->PointN; n++) - pcb_fprintf(ctx->f, "outline_xy(1, %ld) = %mm; outline_xy(2, %ld) = %mm;\n", n+1, p->Points[n].X, n+1, -p->Points[n].Y); + rnd_fprintf(ctx->f, "outline_xy(1, %ld) = %mm; outline_xy(2, %ld) = %mm;\n", n+1, p->Points[n].X, n+1, -p->Points[n].Y); pcb_poly_free(p); } else { /* rectangular board size */ - pcb_fprintf(ctx->f, "outline_xy(1, 1) = 0; outline_xy(2, 1) = 0;\n"); - pcb_fprintf(ctx->f, "outline_xy(1, 2) = %mm; outline_xy(2, 2) = 0;\n", ctx->pcb->hidlib.size_x); - pcb_fprintf(ctx->f, "outline_xy(1, 3) = %mm; outline_xy(2, 3) = %mm;\n", ctx->pcb->hidlib.size_x, -ctx->pcb->hidlib.size_y); - pcb_fprintf(ctx->f, "outline_xy(1, 4) = 0; outline_xy(2, 4) = %mm;\n", -ctx->pcb->hidlib.size_y); + rnd_fprintf(ctx->f, "outline_xy(1, 1) = 0; outline_xy(2, 1) = 0;\n"); + rnd_fprintf(ctx->f, "outline_xy(1, 2) = %mm; outline_xy(2, 2) = 0;\n", ctx->pcb->hidlib.size_x); + rnd_fprintf(ctx->f, "outline_xy(1, 3) = %mm; outline_xy(2, 3) = %mm;\n", ctx->pcb->hidlib.size_x, -ctx->pcb->hidlib.size_y); + rnd_fprintf(ctx->f, "outline_xy(1, 4) = 0; outline_xy(2, 4) = %mm;\n", -ctx->pcb->hidlib.size_y); } /* create all substrate layers using this polygon*/ @@ -392,7 +392,7 @@ if (!isalnum(*s)) *s = '_'; - pcb_fprintf(ctx->f, "\npoint%s(1, 1) = %mm; point%s(2, 1) = %mm;\n", safe_name, x, safe_name, -y); + rnd_fprintf(ctx->f, "\npoint%s(1, 1) = %mm; point%s(2, 1) = %mm;\n", safe_name, x, safe_name, -y); fprintf(ctx->f, "[start%s, stop%s] = CalcPcbrnd2PortV(PCBRND, point%s, %d, %d);\n", safe_name, safe_name, safe_name, ctx->lg_pcb2ems[gid1], ctx->lg_pcb2ems[gid2]); fprintf(ctx->f, "[CSX, port{%ld}] = AddLumpedPort(CSX, 999, %ld, %f, start%s, stop%s, [0 0 -1]%s);\n", ctx->port_id, ctx->port_id, resistance, safe_name, safe_name, act ? ", true" : ""); @@ -512,7 +512,7 @@ { rnd_cardinal_t n; for(n = 0; n < vtc0_len(&l->result); n++) - pcb_fprintf(ctx->f, "%s%mm", (n == 0 ? "" : " "), l->result.array[n]); + rnd_fprintf(ctx->f, "%s%mm", (n == 0 ? "" : " "), l->result.array[n]); } static void openems_write_mesh1(wctx_t *ctx) @@ -554,7 +554,7 @@ } fprintf(ctx->f, "%%%%%% Board mesh, part 2\n"); - pcb_fprintf(ctx->f, "z_bottom_copper=%mm\n", mesh->z_bottom_copper); + rnd_fprintf(ctx->f, "z_bottom_copper=%mm\n", mesh->z_bottom_copper); fprintf(ctx->f, "mesh.y=["); openems_write_mesh_lines(ctx, &mesh->line[PCB_MESH_HORIZONTAL]); @@ -761,9 +761,9 @@ wctx_t *ctx = ems_ctx; long oid = ctx->oid++; - pcb_fprintf(ctx->f, "points%ld(1, 1) = %mm; points%ld(2, 1) = %mm;\n", oid, cx, oid, -cy); - pcb_fprintf(ctx->f, "points%ld(1, 2) = %mm; points%ld(2, 2) = %mm;\n", oid, cx, oid, -cy); - pcb_fprintf(ctx->f, "CSX = AddPcbrndTrace(CSX, PCBRND, %d, points%ld, %mm, 0);\n", ctx->clayer, oid, radius*2); + rnd_fprintf(ctx->f, "points%ld(1, 1) = %mm; points%ld(2, 1) = %mm;\n", oid, cx, oid, -cy); + rnd_fprintf(ctx->f, "points%ld(1, 2) = %mm; points%ld(2, 2) = %mm;\n", oid, cx, oid, -cy); + rnd_fprintf(ctx->f, "CSX = AddPcbrndTrace(CSX, PCBRND, %d, points%ld, %mm, 0);\n", ctx->clayer, oid, radius*2); } static void openems_fill_polygon_offs(rnd_hid_gc_t gc, int n_coords, rnd_coord_t *x, rnd_coord_t *y, rnd_coord_t dx, rnd_coord_t dy) @@ -773,7 +773,7 @@ long oid = ctx->oid++; for(n = 0; n < n_coords; n++) - pcb_fprintf(ctx->f, "poly%ld_xy(1, %ld) = %mm; poly%ld_xy(2, %ld) = %mm;\n", oid, n+1, x[n]+dx, oid, n+1, -(y[n]+dy)); + rnd_fprintf(ctx->f, "poly%ld_xy(1, %ld) = %mm; poly%ld_xy(2, %ld) = %mm;\n", oid, n+1, x[n]+dx, oid, n+1, -(y[n]+dy)); fprintf(ctx->f, "CSX = AddPcbrndPoly(CSX, PCBRND, %d, poly%ld_xy, 1);\n", ctx->clayer, oid); } @@ -799,9 +799,9 @@ } else { long oid = ctx->oid++; - pcb_fprintf(ctx->f, "points%ld(1, 1) = %mm; points%ld(2, 1) = %mm;\n", oid, x1, oid, -y1); - pcb_fprintf(ctx->f, "points%ld(1, 2) = %mm; points%ld(2, 2) = %mm;\n", oid, x2, oid, -y2); - pcb_fprintf(ctx->f, "CSX = AddPcbrndTrace(CSX, PCBRND, %d, points%ld, %mm, 0);\n", ctx->clayer, oid, gc->width); + rnd_fprintf(ctx->f, "points%ld(1, 1) = %mm; points%ld(2, 1) = %mm;\n", oid, x1, oid, -y1); + rnd_fprintf(ctx->f, "points%ld(1, 2) = %mm; points%ld(2, 2) = %mm;\n", oid, x2, oid, -y2); + rnd_fprintf(ctx->f, "CSX = AddPcbrndTrace(CSX, PCBRND, %d, points%ld, %mm, 0);\n", ctx->clayer, oid, gc->width); } } Index: mesh.c =================================================================== --- mesh.c (revision 31006) +++ mesh.c (revision 31007) @@ -125,9 +125,9 @@ static void mesh_auto_add_smooth(vtc0_t *v, rnd_coord_t c1, rnd_coord_t c2, rnd_coord_t d1, rnd_coord_t d, rnd_coord_t d2); #define SAVE_INT(name) \ - pcb_append_printf(dst, "%s " #name" = %d\n", prefix, (int)me->dlg[me->name].val.lng); + rnd_append_printf(dst, "%s " #name" = %d\n", prefix, (int)me->dlg[me->name].val.lng); #define SAVE_COORD(name) \ - pcb_append_printf(dst, "%s " #name" = %.08$$mm\n", prefix, (rnd_coord_t)me->dlg[me->name].val.crd); + rnd_append_printf(dst, "%s " #name" = %.08$$mm\n", prefix, (rnd_coord_t)me->dlg[me->name].val.crd); void pcb_mesh_save(const mesh_dlg_t *me, gds_t *dst, const char *prefix) { int n; @@ -135,7 +135,7 @@ if (prefix == NULL) prefix = ""; - pcb_append_printf(dst, "%sha:pcb-rnd-mesh-v1 {\n", prefix); + rnd_append_printf(dst, "%sha:pcb-rnd-mesh-v1 {\n", prefix); SAVE_COORD(dens_obj); SAVE_COORD(dens_gap); SAVE_COORD(min_space); @@ -151,7 +151,7 @@ SAVE_COORD(max_air); SAVE_COORD(def_subs_thick); SAVE_COORD(def_copper_thick); - pcb_append_printf(dst, "%s li:boundary = {", prefix); + rnd_append_printf(dst, "%s li:boundary = {", prefix); for(n = 0; n < 6; n++) { int bidx = me->dlg[me->bnd[n]].val.lng; const char *bs; @@ -171,10 +171,10 @@ bs = "invalid"; else bs = subslines[sidx]; - pcb_append_printf(dst, "%s subslines = %s\n", prefix, bs); + rnd_append_printf(dst, "%s subslines = %s\n", prefix, bs); } - pcb_append_printf(dst, "%s}\n", prefix); + rnd_append_printf(dst, "%s}\n", prefix); } #undef SAVE_INT #undef SAVE_COORD @@ -1038,7 +1038,7 @@ free(mesh.ui_name_xy); free((char *)mesh.ui_layer_xy->name); /* we have strdup'd it */ - mesh.ui_name_xy = pcb_strdup_printf("mesh 0: %s", mesh.layer->name); + mesh.ui_name_xy = rnd_strdup_printf("mesh 0: %s", mesh.layer->name); mesh.ui_layer_xy->name = rnd_strdup(mesh.ui_name_xy); rnd_event(&PCB->hidlib, PCB_EVENT_LAYERS_CHANGED, NULL);