Index: src_plugins/cam/cam.c =================================================================== --- src_plugins/cam/cam.c (revision 37071) +++ src_plugins/cam/cam.c (revision 37072) @@ -204,7 +204,7 @@ {"cam", pcb_act_cam, pcb_acth_cam, pcb_acts_cam} }; -static const rnd_export_opt_t *export_cam_get_export_options(rnd_hid_t *hid, int *n) +static const rnd_export_opt_t *export_cam_get_export_options(rnd_hid_t *hid, int *n, rnd_design_t *dsg, void *appspec) { return 0; } Index: src_plugins/export_bom/bom.c =================================================================== --- src_plugins/export_bom/bom.c (revision 37071) +++ src_plugins/export_bom/bom.c (revision 37072) @@ -61,11 +61,11 @@ struct pcb_bom_list_s *next; } pcb_bom_list_t; -static const rnd_export_opt_t *bom_get_export_options(rnd_hid_t *hid, int *n) +static const rnd_export_opt_t *bom_get_export_options(rnd_hid_t *hid, int *n, rnd_design_t *dsg, void *appspec) { const char *val = bom_values[HA_bomfile].str; - if ((PCB != NULL) && ((val == NULL) || (*val == '\0'))) - pcb_derive_default_filename(PCB->hidlib.loadname, &bom_values[HA_bomfile], ".bom"); + if ((dsg != NULL) && ((val == NULL) || (*val == '\0'))) + pcb_derive_default_filename(dsg->loadname, &bom_values[HA_bomfile], ".bom"); if (n) *n = NUM_OPTIONS; @@ -227,7 +227,7 @@ pcb_cam_t cam; if (!options) { - bom_get_export_options(hid, 0); + bom_get_export_options(hid, 0, design, appspec); options = bom_values; } Index: src_plugins/export_c_draw/export_c_draw.c =================================================================== --- src_plugins/export_c_draw/export_c_draw.c (revision 37071) +++ src_plugins/export_c_draw/export_c_draw.c (revision 37072) @@ -86,13 +86,13 @@ static rnd_hid_attr_val_t c_draw_values[NUM_OPTIONS]; -static const rnd_export_opt_t *c_draw_get_export_options(rnd_hid_t *hid, int *n) +static const rnd_export_opt_t *c_draw_get_export_options(rnd_hid_t *hid, int *n, rnd_design_t *dsg, void *appspec) { const char *suffix = ".c"; const char *val = c_draw_values[HA_c_drawfile].str; - if ((PCB != NULL) && ((val == NULL) || (*val == '\0'))) - pcb_derive_default_filename(PCB->hidlib.loadname, &c_draw_values[HA_c_drawfile], suffix); + if ((dsg != NULL) && ((val == NULL) || (*val == '\0'))) + pcb_derive_default_filename(dsg->loadname, &c_draw_values[HA_c_drawfile], suffix); if (n) *n = NUM_OPTIONS; @@ -127,7 +127,7 @@ rnd_xform_t xform; if (!options) { - c_draw_get_export_options(hid, 0); + c_draw_get_export_options(hid, 0, design, appspec); options = c_draw_values; } Index: src_plugins/export_debug/export_debug.c =================================================================== --- src_plugins/export_debug/export_debug.c (revision 37071) +++ src_plugins/export_debug/export_debug.c (revision 37072) @@ -94,13 +94,13 @@ static rnd_hid_attr_val_t debug_values[NUM_OPTIONS]; -static const rnd_export_opt_t *debug_get_export_options(rnd_hid_t *hid, int *n) +static const rnd_export_opt_t *debug_get_export_options(rnd_hid_t *hid, int *n, rnd_design_t *dsg, void *appspec) { const char *suffix = ".dump"; const char *val = debug_values[HA_debugfile].str; - if ((PCB != NULL) && ((val == NULL) || (*val == '\0'))) - pcb_derive_default_filename(PCB->hidlib.loadname, &debug_values[HA_debugfile], suffix); + if ((dsg != NULL) && ((val == NULL) || (*val == '\0'))) + pcb_derive_default_filename(dsg->loadname, &debug_values[HA_debugfile], suffix); if (n) *n = NUM_OPTIONS; @@ -134,7 +134,7 @@ rnd_xform_t xform; if (!options) { - debug_get_export_options(hid, 0); + debug_get_export_options(hid, 0, design, appspec); options = debug_values; } Index: src_plugins/export_dxf/dxf.c =================================================================== --- src_plugins/export_dxf/dxf.c (revision 37071) +++ src_plugins/export_dxf/dxf.c (revision 37072) @@ -198,12 +198,12 @@ static rnd_hid_attr_val_t dxf_values[NUM_OPTIONS]; -static const rnd_export_opt_t *dxf_get_export_options(rnd_hid_t *hid, int *n) +static const rnd_export_opt_t *dxf_get_export_options(rnd_hid_t *hid, int *n, rnd_design_t *dsg, void *appspec) { const char *suffix = ".dxf"; const char *val = dxf_values[HA_dxffile].str; - if ((PCB != NULL) && ((val == NULL) || (*val == '\0'))) - pcb_derive_default_filename(PCB->hidlib.loadname, &dxf_values[HA_dxffile], suffix); + if ((dsg != NULL) && ((val == NULL) || (*val == '\0'))) + pcb_derive_default_filename(dsg->loadname, &dxf_values[HA_dxffile], suffix); if (n) *n = NUM_OPTIONS; @@ -272,7 +272,7 @@ rnd_xform_t xform; if (!options) { - dxf_get_export_options(hid, 0); + dxf_get_export_options(hid, 0, design, appspec); options = dxf_values; } Index: src_plugins/export_excellon/excellon.c =================================================================== --- src_plugins/export_excellon/excellon.c (revision 37071) +++ src_plugins/export_excellon/excellon.c (revision 37072) @@ -202,11 +202,11 @@ static rnd_hid_attr_val_t excellon_values[NUM_OPTIONS]; -static const rnd_export_opt_t *excellon_get_export_options(rnd_hid_t *hid, int *n) +static const rnd_export_opt_t *excellon_get_export_options(rnd_hid_t *hid, int *n, rnd_design_t *dsg, void *appspec) { const char *val = excellon_values[HA_excellonfile].str; - if ((PCB != NULL) && ((val == NULL) || (*val == '\0'))) - pcb_derive_default_filename(PCB->hidlib.loadname, &excellon_values[HA_excellonfile], ""); + if ((dsg != NULL) && ((val == NULL) || (*val == '\0'))) + pcb_derive_default_filename(dsg->loadname, &excellon_values[HA_excellonfile], ""); if (n) *n = NUM_OPTIONS; @@ -223,7 +223,7 @@ rnd_xform_t xform; if (!options) { - excellon_get_export_options(hid, NULL); + excellon_get_export_options(hid, NULL, design, appspec); options = excellon_values; } pcb_drill_init(&pdrills, options[HA_apeture_per_file].lng ? NULL : &exc_aperture_cnt); Index: src_plugins/export_fidocadj/fidocadj.c =================================================================== --- src_plugins/export_fidocadj/fidocadj.c (revision 37071) +++ src_plugins/export_fidocadj/fidocadj.c (revision 37072) @@ -81,12 +81,12 @@ static rnd_hid_attr_val_t fidocadj_values[NUM_OPTIONS]; -static const rnd_export_opt_t *fidocadj_get_export_options(rnd_hid_t *hid, int *n) +static const rnd_export_opt_t *fidocadj_get_export_options(rnd_hid_t *hid, int *n, rnd_design_t *dsg, void *appspec) { const char *suffix = ".fcd"; const char *val = fidocadj_values[HA_fidocadjfile].str; - if ((PCB != NULL) && ((val == NULL) || (*val == '\0'))) - pcb_derive_default_filename(PCB->hidlib.loadname, &fidocadj_values[HA_fidocadjfile], suffix); + if ((dsg != NULL) && ((val == NULL) || (*val == '\0'))) + pcb_derive_default_filename(dsg->loadname, &fidocadj_values[HA_fidocadjfile], suffix); if (n) *n = NUM_OPTIONS; @@ -169,7 +169,7 @@ htsi_t lib_names; /* hash of names found in the library, if have_lib is 1 */ if (!options) { - fidocadj_get_export_options(hid, 0); + fidocadj_get_export_options(hid, 0, design, appspec); options = fidocadj_values; } Index: src_plugins/export_gcode/gcode.c =================================================================== --- src_plugins/export_gcode/gcode.c (revision 37071) +++ src_plugins/export_gcode/gcode.c (revision 37072) @@ -102,7 +102,7 @@ static rnd_hid_attr_val_t gcode_values[NUM_OPTIONS]; -static const rnd_export_opt_t *gcode_get_export_options(rnd_hid_t *hid, int *n) +static const rnd_export_opt_t *gcode_get_export_options(rnd_hid_t *hid, int *n, rnd_design_t *dsg, void *appspec) { if (n) *n = NUM_OPTIONS; @@ -331,7 +331,7 @@ pcb_board_t *pcb = PCB; if (!options) { - gcode_get_export_options(hid, 0); + gcode_get_export_options(hid, 0, design, appspec); options = gcode_values; } Index: src_plugins/export_gerber/gerber.c =================================================================== --- src_plugins/export_gerber/gerber.c (revision 37071) +++ src_plugins/export_gerber/gerber.c (revision 37072) @@ -256,11 +256,11 @@ static rnd_hid_attr_val_t gerber_values[NUM_OPTIONS]; -static const rnd_export_opt_t *gerber_get_export_options(rnd_hid_t *hid, int *n) +static const rnd_export_opt_t *gerber_get_export_options(rnd_hid_t *hid, int *n, rnd_design_t *dsg, void *appspec) { const char *val = gerber_values[HA_gerberfile].str; - if ((PCB != NULL) && ((val == NULL) || (*val == '\0'))) - pcb_derive_default_filename(PCB->hidlib.loadname, &gerber_values[HA_gerberfile], ""); + if ((dsg != NULL) && ((val == NULL) || (*val == '\0'))) + pcb_derive_default_filename(dsg->loadname, &gerber_values[HA_gerberfile], ""); if (n) *n = NUM_OPTIONS; @@ -323,7 +323,7 @@ drawing_mode_issued = RND_HID_COMP_POSITIVE; if (!options) { - gerber_get_export_options(hid, NULL); + gerber_get_export_options(hid, NULL, design, appspec); options = gerber_values; } Index: src_plugins/export_hpgl/export_hpgl.c =================================================================== --- src_plugins/export_hpgl/export_hpgl.c (revision 37071) +++ src_plugins/export_hpgl/export_hpgl.c (revision 37072) @@ -89,13 +89,13 @@ static rnd_hid_attr_val_t exp_hpgl_values[NUM_OPTIONS]; -static const rnd_export_opt_t *exp_hpgl_get_export_options(rnd_hid_t *hid, int *n) +static const rnd_export_opt_t *exp_hpgl_get_export_options(rnd_hid_t *hid, int *n, rnd_design_t *dsg, void *appspec) { const char *suffix = ".hpgl"; const char *val = exp_hpgl_values[HA_exp_hpglfile].str; - if ((PCB != NULL) && ((val == NULL) || (*val == '\0'))) - pcb_derive_default_filename(PCB->hidlib.loadname, &exp_hpgl_values[HA_exp_hpglfile], suffix); + if ((dsg != NULL) && ((val == NULL) || (*val == '\0'))) + pcb_derive_default_filename(dsg->loadname, &exp_hpgl_values[HA_exp_hpglfile], suffix); if (n) *n = NUM_OPTIONS; @@ -129,7 +129,7 @@ rnd_xform_t xform; if (!options) { - exp_hpgl_get_export_options(hid, 0); + exp_hpgl_get_export_options(hid, 0, design, appspec); options = exp_hpgl_values; } Index: src_plugins/export_ipcd356/ipcd356.c =================================================================== --- src_plugins/export_ipcd356/ipcd356.c (revision 37071) +++ src_plugins/export_ipcd356/ipcd356.c (revision 37072) @@ -423,11 +423,11 @@ static rnd_hid_attr_val_t ipcd356_values[NUM_OPTIONS]; -static const rnd_export_opt_t *ipcd356_get_export_options(rnd_hid_t *hid, int *n) +static const rnd_export_opt_t *ipcd356_get_export_options(rnd_hid_t *hid, int *n, rnd_design_t *dsg, void *appspec) { const char *val = ipcd356_values[HA_ipcd356_filename].str; - if ((PCB != NULL) && ((val == NULL) || (*val == '\0'))) - pcb_derive_default_filename(PCB->hidlib.loadname, &ipcd356_values[HA_ipcd356_filename], ".net"); + if ((dsg != NULL) && ((val == NULL) || (*val == '\0'))) + pcb_derive_default_filename(dsg->loadname, &ipcd356_values[HA_ipcd356_filename], ".net"); if (n != NULL) *n = NUM_OPTIONS; @@ -447,7 +447,7 @@ pcb_cam_t cam; if (!options) { - ipcd356_get_export_options(hid, 0); + ipcd356_get_export_options(hid, 0, design, appspec); options = ipcd356_values; } Index: src_plugins/export_openems/export_openems.c =================================================================== --- src_plugins/export_openems/export_openems.c (revision 37071) +++ src_plugins/export_openems/export_openems.c (revision 37072) @@ -166,14 +166,14 @@ static rnd_hid_attr_val_t openems_values[NUM_OPTIONS]; -static const rnd_export_opt_t *openems_get_export_options(rnd_hid_t *hid, int *n) +static const rnd_export_opt_t *openems_get_export_options(rnd_hid_t *hid, int *n, rnd_design_t *dsg, void *appspec) { const char *suffix = ".m"; pcb_mesh_t *mesh = pcb_mesh_get(MESH_NAME); const char *val = openems_values[HA_openemsfile].str; - if ((PCB != NULL) && ((val == NULL) || (*val == '\0'))) - pcb_derive_default_filename(PCB->hidlib.loadname, &openems_values[HA_openemsfile], suffix); + if ((dsg != NULL) && ((val == NULL) || (*val == '\0'))) + pcb_derive_default_filename(dsg->loadname, &openems_values[HA_openemsfile], suffix); if (mesh != NULL) { openems_values[HA_def_substrate_thick].crd = mesh->def_subs_thick; @@ -676,7 +676,7 @@ openems_ovr = 0; if (!options) { - openems_get_export_options(hid, 0); + openems_get_export_options(hid, 0, design, appspec); options = openems_values; } Index: src_plugins/export_openscad/export_openscad.c =================================================================== --- src_plugins/export_openscad/export_openscad.c (revision 37071) +++ src_plugins/export_openscad/export_openscad.c (revision 37072) @@ -131,13 +131,13 @@ static rnd_hid_attr_val_t openscad_values[NUM_OPTIONS]; -static const rnd_export_opt_t *openscad_get_export_options(rnd_hid_t *hid, int *n) +static const rnd_export_opt_t *openscad_get_export_options(rnd_hid_t *hid, int *n, rnd_design_t *dsg, void *appspec) { const char *suffix = ".scad"; const char *val = openscad_values[HA_openscadfile].str; - if ((PCB != NULL) && ((val == NULL) || (*val == '\0'))) - pcb_derive_default_filename(PCB->hidlib.loadname, &openscad_values[HA_openscadfile], suffix); + if ((dsg != NULL) && ((val == NULL) || (*val == '\0'))) + pcb_derive_default_filename(dsg->loadname, &openscad_values[HA_openscadfile], suffix); if (n) *n = NUM_OPTIONS; @@ -304,7 +304,7 @@ pcb_cam_t cam; if (!options) { - openscad_get_export_options(hid, 0); + openscad_get_export_options(hid, 0, design, appspec); options = openscad_values; } Index: src_plugins/export_png/png.c =================================================================== --- src_plugins/export_png/png.c (revision 37071) +++ src_plugins/export_png/png.c (revision 37072) @@ -296,13 +296,13 @@ static rnd_hid_attr_val_t png_values[NUM_OPTIONS]; -static const rnd_export_opt_t *png_get_export_options(rnd_hid_t *hid, int *n) +static const rnd_export_opt_t *png_get_export_options(rnd_hid_t *hid, int *n, rnd_design_t *dsg, void *appspec) { const char *suffix = rnd_drwpx_get_file_suffix(png_values[HA_filetype].lng); const char *val = png_values[HA_pngfile].str; - if ((PCB != NULL) && ((val == NULL) || (*val == '\0'))) - pcb_derive_default_filename(PCB->hidlib.loadname, &png_values[HA_pngfile], suffix); + if ((dsg != NULL) && ((val == NULL) || (*val == '\0'))) + pcb_derive_default_filename(dsg->loadname, &png_values[HA_pngfile], suffix); if (n) *n = NUM_OPTIONS; @@ -436,7 +436,7 @@ rnd_drwpx_init(pctx, &PCB->hidlib); if (!options) { - png_get_export_options(hid, 0); + png_get_export_options(hid, 0, design, appspec); options = png_values; } Index: src_plugins/export_ps/eps.c =================================================================== --- src_plugins/export_ps/eps.c (revision 37071) +++ src_plugins/export_ps/eps.c (revision 37072) @@ -112,12 +112,12 @@ static rnd_hid_attr_val_t eps_values[NUM_OPTIONS]; -static const rnd_export_opt_t *eps_get_export_options(rnd_hid_t *hid, int *n) +static const rnd_export_opt_t *eps_get_export_options(rnd_hid_t *hid, int *n, rnd_design_t *dsg, void *appspec) { const char *val = eps_values[HA_psfile].str; - if ((PCB != NULL) && ((val == NULL) || (*val == '\0'))) - pcb_derive_default_filename(PCB->hidlib.loadname, &eps_values[HA_psfile], ".eps"); + if ((dsg != NULL) && ((val == NULL) || (*val == '\0'))) + pcb_derive_default_filename(dsg->loadname, &eps_values[HA_psfile], ".eps"); if (n) *n = NUM_OPTIONS; @@ -255,7 +255,7 @@ rnd_xform_t xform; if (!options) { - eps_get_export_options(hid, 0); + eps_get_export_options(hid, 0, design, appspec); options = eps_values; } Index: src_plugins/export_ps/ps.c =================================================================== --- src_plugins/export_ps/ps.c (revision 37071) +++ src_plugins/export_ps/ps.c (revision 37072) @@ -315,12 +315,12 @@ int had_page; /* 1 if we ever wrote a page */ } global; -static const rnd_export_opt_t *ps_get_export_options(rnd_hid_t *hid, int *n) +static const rnd_export_opt_t *ps_get_export_options(rnd_hid_t *hid, int *n, rnd_design_t *dsg, void *appspec) { const char *val = global.ps_values[HA_psfile].str; - if ((PCB != NULL) && ((val == NULL) || (*val == '\0'))) - pcb_derive_default_filename(PCB->hidlib.loadname, &global.ps_values[HA_psfile], ".ps"); + if ((dsg != NULL) && ((val == NULL) || (*val == '\0'))) + pcb_derive_default_filename(dsg->loadname, &global.ps_values[HA_psfile], ".ps"); if (n) *n = NUM_OPTIONS; @@ -442,7 +442,7 @@ global.ovr_all = 0; if (!options) { - ps_get_export_options(hid, 0); + ps_get_export_options(hid, 0, design, appspec); options = global.ps_values; } Index: src_plugins/export_stat/stat.c =================================================================== --- src_plugins/export_stat/stat.c (revision 37071) +++ src_plugins/export_stat/stat.c (revision 37072) @@ -110,13 +110,13 @@ static rnd_hid_attr_val_t stat_values[NUM_OPTIONS]; -static const rnd_export_opt_t *stat_get_export_options(rnd_hid_t *hid, int *n) +static const rnd_export_opt_t *stat_get_export_options(rnd_hid_t *hid, int *n, rnd_design_t *dsg, void *appspec) { const char *suffix = ".stat.lht"; const char *val = stat_values[HA_statfile].str; - if ((PCB != NULL) && ((val == NULL) || (*val == '\0'))) - pcb_derive_default_filename(PCB->hidlib.loadname, &stat_values[HA_statfile], suffix); + if ((dsg != NULL) && ((val == NULL) || (*val == '\0'))) + pcb_derive_default_filename(dsg->loadname, &stat_values[HA_statfile], suffix); if (n) *n = NUM_OPTIONS; @@ -146,7 +146,7 @@ memset(group_not_empty, 0, sizeof(group_not_empty)); if (!options) { - stat_get_export_options(hid, 0); + stat_get_export_options(hid, 0, design, appspec); options = stat_values; } Index: src_plugins/export_stl/export_stl.c =================================================================== --- src_plugins/export_stl/export_stl.c (revision 37071) +++ src_plugins/export_stl/export_stl.c (revision 37072) @@ -363,13 +363,13 @@ stl_facet_t *(*model_load)(rnd_design_t *hl, FILE *f, const char *fn); } stl_fmt_t; -static const rnd_export_opt_t *stl_get_export_options_(rnd_hid_t *hid, int *n, const stl_fmt_t *fmt) +static const rnd_export_opt_t *stl_get_export_options_(rnd_hid_t *hid, int *n, const stl_fmt_t *fmt, rnd_design_t *dsg, void *appspec) { const char *suffix = fmt->suffix; const char *val = stl_values[HA_stlfile].str; - if ((PCB != NULL) && ((val == NULL) || (*val == '\0'))) - pcb_derive_default_filename(PCB->hidlib.loadname, &stl_values[HA_stlfile], suffix); + if ((dsg != NULL) && ((val == NULL) || (*val == '\0'))) + pcb_derive_default_filename(dsg->loadname, &stl_values[HA_stlfile], suffix); if (n) *n = NUM_OPTIONS; @@ -387,19 +387,19 @@ #include "model_load_amf.c" -static const rnd_export_opt_t *stl_get_export_options(rnd_hid_t *hid, int *n) +static const rnd_export_opt_t *stl_get_export_options(rnd_hid_t *hid, int *n, rnd_design_t *dsg, void *appspec) { - return stl_get_export_options_(hid, n, &fmt_stl); + return stl_get_export_options_(hid, n, &fmt_stl, dsg, appspec); } -static const rnd_export_opt_t *amf_get_export_options(rnd_hid_t *hid, int *n) +static const rnd_export_opt_t *amf_get_export_options(rnd_hid_t *hid, int *n, rnd_design_t *dsg, void *appspec) { - return stl_get_export_options_(hid, n, &fmt_amf); + return stl_get_export_options_(hid, n, &fmt_amf, dsg, appspec); } -static const rnd_export_opt_t *proj_get_export_options(rnd_hid_t *hid, int *n) +static const rnd_export_opt_t *proj_get_export_options(rnd_hid_t *hid, int *n, rnd_design_t *dsg, void *appspec) { - return stl_get_export_options_(hid, n, &fmt_proj); + return stl_get_export_options_(hid, n, &fmt_proj, dsg, appspec); } static int stl_hid_export_to_file(FILE *f, rnd_hid_attr_val_t *options, rnd_coord_t maxy, rnd_coord_t z0, rnd_coord_t z1, const stl_fmt_t *fmt) @@ -522,7 +522,7 @@ return 0; } -static void stl_do_export_(rnd_hid_t *hid, rnd_hid_attr_val_t *options, const stl_fmt_t *fmt) +static void stl_do_export_(rnd_hid_t *hid, rnd_hid_attr_val_t *options, const stl_fmt_t *fmt, rnd_design_t *dsg, void *appspec) { const char *filename; pcb_cam_t cam; @@ -530,7 +530,7 @@ rnd_coord_t thick; if (!options) { - stl_get_export_options_(hid, 0, fmt); + stl_get_export_options_(hid, 0, fmt, dsg, appspec); options = stl_values; } @@ -565,17 +565,17 @@ static void stl_do_export(rnd_hid_t *hid, rnd_design_t *design, rnd_hid_attr_val_t *options, void *appspec) { - stl_do_export_(hid, options, &fmt_stl); + stl_do_export_(hid, options, &fmt_stl, design, appspec); } static void amf_do_export(rnd_hid_t *hid, rnd_design_t *design, rnd_hid_attr_val_t *options, void *appspec) { - stl_do_export_(hid, options, &fmt_amf); + stl_do_export_(hid, options, &fmt_amf, design, appspec); } static void proj_do_export(rnd_hid_t *hid, rnd_design_t *design, rnd_hid_attr_val_t *options, void *appspec) { - stl_do_export_(hid, options, &fmt_proj); + stl_do_export_(hid, options, &fmt_proj, design, appspec); } static int stl_parse_arguments(rnd_hid_t *hid, int *argc, char ***argv) Index: src_plugins/export_svg/svg.c =================================================================== --- src_plugins/export_svg/svg.c (revision 37071) +++ src_plugins/export_svg/svg.c (revision 37072) @@ -142,13 +142,13 @@ static rnd_hid_attr_val_t svg_values[NUM_OPTIONS]; -static const rnd_export_opt_t *svg_get_export_options(rnd_hid_t *hid, int *n) +static const rnd_export_opt_t *svg_get_export_options(rnd_hid_t *hid, int *n, rnd_design_t *dsg, void *appspec) { const char *suffix = ".svg"; const char *val = svg_values[HA_svgfile].str; - if ((PCB != NULL) && ((val == NULL) || (*val == '\0'))) - pcb_derive_default_filename(PCB->hidlib.loadname, &svg_values[HA_svgfile], suffix); + if ((dsg != NULL) && ((val == NULL) || (*val == '\0'))) + pcb_derive_default_filename(dsg->loadname, &svg_values[HA_svgfile], suffix); if (n) *n = NUM_OPTIONS; @@ -226,7 +226,7 @@ pctx->comp_cnt = 0; if (!options) { - svg_get_export_options(hid, 0); + svg_get_export_options(hid, 0, design, appspec); options = svg_values; } Index: src_plugins/export_vfs_fuse/export_vfs_fuse.c =================================================================== --- src_plugins/export_vfs_fuse/export_vfs_fuse.c (revision 37071) +++ src_plugins/export_vfs_fuse/export_vfs_fuse.c (revision 37072) @@ -38,7 +38,7 @@ static int pcb_fuse_changed; static char fuse_cwd[RND_PATH_MAX]; -static const rnd_export_opt_t *export_vfs_fuse_get_export_options(rnd_hid_t *hid, int *n) +static const rnd_export_opt_t *export_vfs_fuse_get_export_options(rnd_hid_t *hid, int *n, rnd_design_t *dsg, void *appspec) { return 0; } Index: src_plugins/export_vfs_mc/export_vfs_mc.c =================================================================== --- src_plugins/export_vfs_mc/export_vfs_mc.c (revision 37071) +++ src_plugins/export_vfs_mc/export_vfs_mc.c (revision 37072) @@ -38,7 +38,7 @@ static rnd_hid_attr_val_t export_vfs_mc_values[NUM_OPTIONS]; -static const rnd_export_opt_t *export_vfs_mc_get_export_options(rnd_hid_t *hid, int *n) +static const rnd_export_opt_t *export_vfs_mc_get_export_options(rnd_hid_t *hid, int *n, rnd_design_t *dsg, void *appspec) { if (n) *n = NUM_OPTIONS; @@ -107,7 +107,7 @@ const char *cmd; if (!options) { - export_vfs_mc_get_export_options(hid, 0); + export_vfs_mc_get_export_options(hid, 0, design, appspec); options = export_vfs_mc_values; } Index: src_plugins/export_xy/xy.c =================================================================== --- src_plugins/export_xy/xy.c (revision 37071) +++ src_plugins/export_xy/xy.c (revision 37072) @@ -102,7 +102,7 @@ } } -static const rnd_export_opt_t *xy_get_export_options(rnd_hid_t *hid, int *n) +static const rnd_export_opt_t *xy_get_export_options(rnd_hid_t *hid, int *n, rnd_design_t *dsg, void *appspec) { static int last_unit_value = -1; rnd_conf_listitem_t *li; @@ -152,8 +152,8 @@ last_unit_value = xy_values[HA_unit].lng; } - if ((PCB != NULL) && ((val == NULL) || (*val == '\0'))) - pcb_derive_default_filename(PCB->hidlib.loadname, &xy_values[HA_xyfile], ".xy"); + if ((dsg != NULL) && ((val == NULL) || (*val == '\0'))) + pcb_derive_default_filename(dsg->loadname, &xy_values[HA_xyfile], ".xy"); if (n) *n = NUM_OPTIONS; @@ -945,7 +945,7 @@ gather_templates(); if (!options) { - xy_get_export_options(hid, 0); + xy_get_export_options(hid, 0, design, appspec); options = xy_values; } Index: src_plugins/io_dsn/export.c =================================================================== --- src_plugins/io_dsn/export.c (revision 37071) +++ src_plugins/io_dsn/export.c (revision 37072) @@ -67,11 +67,11 @@ static const char *dsn_filename; -static const rnd_export_opt_t *dsn_get_export_options(rnd_hid_t *hid, int *n) +static const rnd_export_opt_t *dsn_get_export_options(rnd_hid_t *hid, int *n, rnd_design_t *dsg, void *appspec) { const char *val = dsn_values[HA_dsnfile].str; - if ((PCB != NULL) && ((val == NULL) || (*val == '\0'))) - pcb_derive_default_filename(PCB->hidlib.loadname, &dsn_values[HA_dsnfile], ".dsn"); + if ((dsg != NULL) && ((val == NULL) || (*val == '\0'))) + pcb_derive_default_filename(dsg->loadname, &dsn_values[HA_dsnfile], ".dsn"); if (n) *n = NUM_OPTIONS; return dsn_options; @@ -87,7 +87,7 @@ int restore_conf = 0; if (!options) { - dsn_get_export_options(hid, 0); + dsn_get_export_options(hid, 0, design, appspec); options = dsn_values; } dsn_filename = options[HA_dsnfile].str; Index: src_plugins/io_tedax/tetest.c =================================================================== --- src_plugins/io_tedax/tetest.c (revision 37071) +++ src_plugins/io_tedax/tetest.c (revision 37072) @@ -187,11 +187,11 @@ static const char *tedax_etest_filename; -static const rnd_export_opt_t *tedax_etest_get_export_options(rnd_hid_t *hid, int *n) +static const rnd_export_opt_t *tedax_etest_get_export_options(rnd_hid_t *hid, int *n, rnd_design_t *dsg, void *appspec) { const char *val = tedax_etest_values[HA_outfile].str; - if ((PCB != NULL) && (val == NULL)) - pcb_derive_default_filename(PCB->hidlib.loadname, &tedax_etest_values[HA_outfile], ".etest.tdx"); + if ((dsg != NULL) && (val == NULL)) + pcb_derive_default_filename(dsg->loadname, &tedax_etest_values[HA_outfile], ".etest.tdx"); if (n) *n = NUM_OPTIONS; @@ -205,7 +205,7 @@ pcb_cam_t cam; if (!options) { - tedax_etest_get_export_options(hid, 0); + tedax_etest_get_export_options(hid, 0, design, appspec); for (i = 0; i < NUM_OPTIONS; i++) tedax_etest_values[i] = tedax_etest_options[i].default_val; options = tedax_etest_values;