Index: trunk/src_plugins/cam/cam.c =================================================================== --- trunk/src_plugins/cam/cam.c (revision 34299) +++ trunk/src_plugins/cam/cam.c (revision 34300) @@ -204,7 +204,7 @@ {"cam", pcb_act_cam, pcb_acth_cam, pcb_acts_cam} }; -static 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) { return 0; } Index: trunk/src_plugins/dialogs/dlg_export.c =================================================================== --- trunk/src_plugins/dialogs/dlg_export.c (revision 34299) +++ trunk/src_plugins/dialogs/dlg_export.c (revision 34300) @@ -189,7 +189,7 @@ export_ctx.tabs = RND_DAD_CURRENT(export_ctx.dlg); for(n = 0; n < export_ctx.len; n++) { int numo; - rnd_export_opt_t *opts = export_ctx.hid[n]->get_export_options(export_ctx.hid[n], &numo); + const rnd_export_opt_t *opts = export_ctx.hid[n]->get_export_options(export_ctx.hid[n], &numo); rnd_hid_attr_val_t *args = export_ctx.hid[n]->argument_array; export_ctx.numo[n] = numo; export_ctx.aa[n] = args; Index: trunk/src_plugins/export_bom/bom.c =================================================================== --- trunk/src_plugins/export_bom/bom.c (revision 34299) +++ trunk/src_plugins/export_bom/bom.c (revision 34300) @@ -61,7 +61,7 @@ struct pcb_bom_list_s *next; } pcb_bom_list_t; -static 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) { char **val = &bom_values[HA_bomfile].str; if ((PCB != NULL) && ((val == NULL) || (*val == NULL) || (**val == '\0'))) Index: trunk/src_plugins/export_c_draw/export_c_draw.c =================================================================== --- trunk/src_plugins/export_c_draw/export_c_draw.c (revision 34299) +++ trunk/src_plugins/export_c_draw/export_c_draw.c (revision 34300) @@ -86,7 +86,7 @@ static rnd_hid_attr_val_t c_draw_values[NUM_OPTIONS]; -static 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) { const char *suffix = ".c"; char **val = &c_draw_values[HA_c_drawfile].str; Index: trunk/src_plugins/export_dsn/dsn.c =================================================================== --- trunk/src_plugins/export_dsn/dsn.c (revision 34299) +++ trunk/src_plugins/export_dsn/dsn.c (revision 34300) @@ -108,7 +108,7 @@ static const char *dsn_filename; -static 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) { char **val = &dsn_values[HA_dsnfile].str; if ((PCB != NULL) && ((val == NULL) || (*val == NULL) || (**val == '\0'))) Index: trunk/src_plugins/export_dxf/dxf.c =================================================================== --- trunk/src_plugins/export_dxf/dxf.c (revision 34299) +++ trunk/src_plugins/export_dxf/dxf.c (revision 34300) @@ -198,7 +198,7 @@ static rnd_hid_attr_val_t dxf_values[NUM_OPTIONS]; -static 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) { const char *suffix = ".dxf"; char **val = &dxf_values[HA_dxffile].str; Index: trunk/src_plugins/export_excellon/excellon.c =================================================================== --- trunk/src_plugins/export_excellon/excellon.c (revision 34299) +++ trunk/src_plugins/export_excellon/excellon.c (revision 34300) @@ -202,7 +202,7 @@ static rnd_hid_attr_val_t excellon_values[NUM_OPTIONS]; -static 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) { char **val = &excellon_values[HA_excellonfile].str; if ((PCB != NULL) && ((val == NULL) || (*val == NULL) || (**val == '\0'))) Index: trunk/src_plugins/export_fidocadj/fidocadj.c =================================================================== --- trunk/src_plugins/export_fidocadj/fidocadj.c (revision 34299) +++ trunk/src_plugins/export_fidocadj/fidocadj.c (revision 34300) @@ -81,7 +81,7 @@ static rnd_hid_attr_val_t fidocadj_values[NUM_OPTIONS]; -static 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) { const char *suffix = ".fcd"; char **val = &fidocadj_values[HA_fidocadjfile].str; Index: trunk/src_plugins/export_gcode/gcode.c =================================================================== --- trunk/src_plugins/export_gcode/gcode.c (revision 34299) +++ trunk/src_plugins/export_gcode/gcode.c (revision 34300) @@ -102,7 +102,7 @@ static rnd_hid_attr_val_t gcode_values[NUM_OPTIONS]; -static 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) { if (n) *n = NUM_OPTIONS; Index: trunk/src_plugins/export_gerber/gerber.c =================================================================== --- trunk/src_plugins/export_gerber/gerber.c (revision 34299) +++ trunk/src_plugins/export_gerber/gerber.c (revision 34300) @@ -258,7 +258,7 @@ static rnd_hid_attr_val_t gerber_values[NUM_OPTIONS]; -static 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) { char **val = &gerber_values[HA_gerberfile].str; if ((PCB != NULL) && ((val == NULL) || (*val == NULL) || (**val == '\0'))) Index: trunk/src_plugins/export_ipcd356/ipcd356.c =================================================================== --- trunk/src_plugins/export_ipcd356/ipcd356.c (revision 34299) +++ trunk/src_plugins/export_ipcd356/ipcd356.c (revision 34300) @@ -423,7 +423,7 @@ static rnd_hid_attr_val_t ipcd356_values[NUM_OPTIONS]; -static 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) { char **val = &ipcd356_values[HA_ipcd356_filename].str; if ((PCB != NULL) && ((val == NULL) || (*val == NULL) || (**val == '\0'))) Index: trunk/src_plugins/export_lpr/lpr.c =================================================================== --- trunk/src_plugins/export_lpr/lpr.c (revision 34299) +++ trunk/src_plugins/export_lpr/lpr.c (revision 34300) @@ -43,7 +43,7 @@ static int num_lpr_options = 0; static rnd_hid_attr_val_t lpr_values[NUM_OPTIONS]; -static rnd_export_opt_t *lpr_get_export_options(rnd_hid_t *hid, int *n) +static const rnd_export_opt_t *lpr_get_export_options(rnd_hid_t *hid, int *n) { char **val; Index: trunk/src_plugins/export_openems/export_openems.c =================================================================== --- trunk/src_plugins/export_openems/export_openems.c (revision 34299) +++ trunk/src_plugins/export_openems/export_openems.c (revision 34300) @@ -166,27 +166,27 @@ static rnd_hid_attr_val_t openems_values[NUM_OPTIONS]; -static 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) { const char *suffix = ".m"; pcb_mesh_t *mesh = pcb_mesh_get(MESH_NAME); - char **val = &openems_values[HA_openemsfile].str; + const char *val = openems_values[HA_openemsfile].str; - if ((PCB != NULL) && ((val == NULL) || (*val == NULL) || (**val == '\0'))) + if ((PCB != NULL) && ((val == NULL) || (*val == '\0'))) pcb_derive_default_filename(PCB->hidlib.filename, &openems_values[HA_openemsfile], suffix); if (mesh != NULL) { - openems_attribute_list[HA_def_substrate_thick].default_val.crd = mesh->def_subs_thick; - openems_attribute_list[HA_def_copper_thick].default_val.crd = mesh->def_copper_thick; + openems_values[HA_def_substrate_thick].crd = mesh->def_subs_thick; + openems_values[HA_def_copper_thick].crd = mesh->def_copper_thick; } TODO(": when export dialogs change into DAD, this hack to convert the strings to allocated ones will not be needed anymore") - openems_attribute_list[HA_def_copper_cond].default_val.str = rnd_strdup(openems_attribute_list[HA_def_copper_cond].default_val.str); - openems_attribute_list[HA_def_subst_epsilon].default_val.str = rnd_strdup(openems_attribute_list[HA_def_subst_epsilon].default_val.str); - openems_attribute_list[HA_def_subst_mue].default_val.str = rnd_strdup(openems_attribute_list[HA_def_subst_mue].default_val.str); - openems_attribute_list[HA_def_subst_kappa].default_val.str = rnd_strdup(openems_attribute_list[HA_def_subst_kappa].default_val.str); - openems_attribute_list[HA_def_subst_sigma].default_val.str = rnd_strdup(openems_attribute_list[HA_def_subst_sigma].default_val.str); - openems_attribute_list[HA_void_name].default_val.str = rnd_strdup(openems_attribute_list[HA_void_name].default_val.str); + openems_values[HA_def_copper_cond].str = rnd_strdup(openems_attribute_list[HA_def_copper_cond].default_val.str); + openems_values[HA_def_subst_epsilon].str = rnd_strdup(openems_attribute_list[HA_def_subst_epsilon].default_val.str); + openems_values[HA_def_subst_mue].str = rnd_strdup(openems_attribute_list[HA_def_subst_mue].default_val.str); + openems_values[HA_def_subst_kappa].str = rnd_strdup(openems_attribute_list[HA_def_subst_kappa].default_val.str); + openems_values[HA_def_subst_sigma].str = rnd_strdup(openems_attribute_list[HA_def_subst_sigma].default_val.str); + openems_values[HA_void_name].str = rnd_strdup(openems_attribute_list[HA_void_name].default_val.str); if (n) *n = NUM_OPTIONS; Index: trunk/src_plugins/export_openscad/export_openscad.c =================================================================== --- trunk/src_plugins/export_openscad/export_openscad.c (revision 34299) +++ trunk/src_plugins/export_openscad/export_openscad.c (revision 34300) @@ -131,7 +131,7 @@ static rnd_hid_attr_val_t openscad_values[NUM_OPTIONS]; -static 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) { const char *suffix = ".scad"; char **val = &openscad_values[HA_openscadfile].str; Index: trunk/src_plugins/export_png/png.c =================================================================== --- trunk/src_plugins/export_png/png.c (revision 34299) +++ trunk/src_plugins/export_png/png.c (revision 34300) @@ -398,7 +398,7 @@ return result; } -static 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) { const char *suffix = get_file_suffix(); char *val = &png_values[HA_pngfile].str; Index: trunk/src_plugins/export_ps/eps.c =================================================================== --- trunk/src_plugins/export_ps/eps.c (revision 34299) +++ trunk/src_plugins/export_ps/eps.c (revision 34300) @@ -118,7 +118,7 @@ static rnd_hid_attr_val_t eps_values[NUM_OPTIONS]; -static 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) { char **val = &eps_values[HA_psfile].str; Index: trunk/src_plugins/export_ps/ps.c =================================================================== --- trunk/src_plugins/export_ps/ps.c (revision 34299) +++ trunk/src_plugins/export_ps/ps.c (revision 34300) @@ -339,11 +339,11 @@ long drawn_objs; } global; -static 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) { - char **val = &global.ps_values[HA_psfile].str; + const char *val = global.ps_values[HA_psfile].str; - if ((PCB != NULL) && ((val == NULL) || (*val == NULL) || (**val == '\0'))) + if ((PCB != NULL) && ((val == NULL) || (*val == '\0'))) pcb_derive_default_filename(PCB->hidlib.filename, &global.ps_values[HA_psfile], ".ps"); if (n) @@ -1348,7 +1348,7 @@ if (guess(xval, 15, &global.calibration_x)) if (guess(xval, 7.5, &global.calibration_x)) { if (xval < 2) - ps_attribute_list[HA_xcalib].default_val.dbl = global.calibration_x = xval; + global.ps_values[HA_xcalib].dbl = global.calibration_x = xval; else rnd_message(RND_MSG_ERROR, "X value of %g is too far off.\n" "Expecting it near: 1.0, 4.0, 15.0, 7.5\n", xval); } @@ -1356,7 +1356,7 @@ if (guess(yval, 20, &global.calibration_y)) if (guess(yval, 10, &global.calibration_y)) { if (yval < 2) - ps_attribute_list[HA_ycalib].default_val.dbl = global.calibration_y = yval; + global.ps_values[HA_ycalib].dbl = global.calibration_y = yval; else rnd_message(RND_MSG_ERROR, "Y value of %g is too far off.\n" "Expecting it near: 1.0, 4.0, 20.0, 10.0\n", yval); } Index: trunk/src_plugins/export_stat/stat.c =================================================================== --- trunk/src_plugins/export_stat/stat.c (revision 34299) +++ trunk/src_plugins/export_stat/stat.c (revision 34300) @@ -110,7 +110,7 @@ static rnd_hid_attr_val_t stat_values[NUM_OPTIONS]; -static 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) { const char *suffix = ".stat.lht"; char **val = &stat_values[HA_statfile].str; @@ -388,10 +388,10 @@ void pplg_uninit_export_stat(void) { - free((char *)stat_attribute_list[HA_first_ver].default_val.str); - free((char *)stat_attribute_list[HA_license].default_val.str); - stat_attribute_list[HA_first_ver].default_val.str = NULL; - stat_attribute_list[HA_license].default_val.str = NULL; + free((char *)stat_values[HA_first_ver].str); + free((char *)stat_values[HA_license].str); + stat_values[HA_first_ver].str = NULL; + stat_values[HA_license].str = NULL; rnd_export_remove_opts_by_cookie(stat_cookie); rnd_hid_remove_hid(&stat_hid); } Index: trunk/src_plugins/export_stl/export_stl.c =================================================================== --- trunk/src_plugins/export_stl/export_stl.c (revision 34299) +++ trunk/src_plugins/export_stl/export_stl.c (revision 34300) @@ -92,7 +92,7 @@ static rnd_hid_attr_val_t stl_values[NUM_OPTIONS]; -static 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) { const char *suffix = ".stl"; char **val = &stl_values[HA_stlfile].str; Index: trunk/src_plugins/export_svg/svg.c =================================================================== --- trunk/src_plugins/export_svg/svg.c (revision 34299) +++ trunk/src_plugins/export_svg/svg.c (revision 34300) @@ -199,7 +199,7 @@ static rnd_hid_attr_val_t svg_values[NUM_OPTIONS]; -static 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) { const char *suffix = ".svg"; char **val = &svg_values[HA_svgfile].str; Index: trunk/src_plugins/export_vfs_fuse/export_vfs_fuse.c =================================================================== --- trunk/src_plugins/export_vfs_fuse/export_vfs_fuse.c (revision 34299) +++ trunk/src_plugins/export_vfs_fuse/export_vfs_fuse.c (revision 34300) @@ -38,7 +38,7 @@ static int pcb_fuse_changed; static char fuse_cwd[RND_PATH_MAX]; -static 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) { return 0; } Index: trunk/src_plugins/export_vfs_mc/export_vfs_mc.c =================================================================== --- trunk/src_plugins/export_vfs_mc/export_vfs_mc.c (revision 34299) +++ trunk/src_plugins/export_vfs_mc/export_vfs_mc.c (revision 34300) @@ -38,7 +38,7 @@ static rnd_hid_attr_val_t export_vfs_mc_values[NUM_OPTIONS]; -static 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) { if (n) *n = NUM_OPTIONS; Index: trunk/src_plugins/export_xy/xy.c =================================================================== --- trunk/src_plugins/export_xy/xy.c (revision 34299) +++ trunk/src_plugins/export_xy/xy.c (revision 34300) @@ -47,7 +47,8 @@ #define MAX_TEMP_NAME_LEN 128 -static const rnd_export_opt_t xy_options[] = { +/* This one can not be const because format enumeration is loaded run-time */ +static rnd_export_opt_t xy_options[] = { /* %start-doc options "8 XY Creation" @ftable @code @item --xyfile @@ -97,11 +98,11 @@ } } -static 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) { static int last_unit_value = -1; rnd_conf_listitem_t *li; - char **val = &xy_values[HA_xyfile].str; + const char *val = xy_values[HA_xyfile].str; int idx; /* load all formats from the config */ @@ -139,15 +140,15 @@ xy_options[HA_format].enumerations = (const char **)fmt_names.array; /* set default unit and filename */ - if (xy_options[HA_unit].default_val.lng == last_unit_value) { + if (xy_values[HA_unit].lng == last_unit_value) { if (rnd_conf.editor.grid_unit) - xy_options[HA_unit].default_val.lng = rnd_conf.editor.grid_unit->index; + xy_values[HA_unit].lng = rnd_conf.editor.grid_unit->index; else - xy_options[HA_unit].default_val.lng = rnd_get_unit_struct("mil")->index; - last_unit_value = xy_options[HA_unit].default_val.lng; + xy_values[HA_unit].lng = rnd_get_unit_struct("mil")->index; + last_unit_value = xy_values[HA_unit].lng; } - if ((PCB != NULL) && ((val == NULL) || (*val == NULL) || (**val == '\0'))) + if ((PCB != NULL) && ((val == NULL) || (*val == '\0'))) pcb_derive_default_filename(PCB->hidlib.filename, &xy_values[HA_xyfile], ".xy"); if (n) Index: trunk/src_plugins/io_tedax/tetest.c =================================================================== --- trunk/src_plugins/io_tedax/tetest.c (revision 34299) +++ trunk/src_plugins/io_tedax/tetest.c (revision 34300) @@ -187,7 +187,7 @@ static const char *tedax_etest_filename; -static 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) { char *val = tedax_etest_values[HA_outfile].str; if ((PCB != NULL) && (val == NULL))