Index: trunk/src/conf_core.c =================================================================== --- trunk/src/conf_core.c (revision 30206) +++ trunk/src/conf_core.c (revision 30207) @@ -2,6 +2,7 @@ #include #include "conf_core.h" #include +#include TODO("win32: remove this once the w32_ dir workaround is removed") #include @@ -22,6 +23,22 @@ *((type *)(&var)) = max; \ } while(0) +void pcb_conf_legacy(const char *dst_path, const char *legacy_path) +{ + conf_native_t *nl = pcb_conf_get_field(legacy_path); + if (nl != NULL) { + gds_t tmp; + + gds_init(&tmp); + pcb_conf_print_native_field((conf_pfn)pcb_append_printf, &tmp, 0, &nl->val, nl->type, nl->prop, 0); + if (tmp.used > 0) + pcb_conf_set(CFR_INTERNAL, dst_path, -1, tmp.array, POL_OVERWRITE); + gds_uninit(&tmp); + } + else + pcb_message(PCB_MSG_ERROR, "drc_query: invalid legacy path '%s' for %s\n", legacy_path, dst_path); +} + static void conf_core_postproc(void) { conf_clamp_to(CFT_COORD, conf_core.design.line_thickness, PCB_MIN_THICKNESS, PCB_MAX_THICKNESS, PCB_MIL_TO_COORD(10)); Index: trunk/src/conf_core.h =================================================================== --- trunk/src/conf_core.h (revision 30206) +++ trunk/src/conf_core.h (revision 30207) @@ -223,4 +223,6 @@ extern conf_core_t conf_core; void conf_core_init(); +void pcb_conf_legacy(const char *dst_path, const char *legacy_path); + #endif Index: trunk/src_plugins/drc_query/drc_query.c =================================================================== --- trunk/src_plugins/drc_query/drc_query.c (revision 30206) +++ trunk/src_plugins/drc_query/drc_query.c (revision 30207) @@ -31,7 +31,6 @@ #include "config.h" #include -#include #include #include #include @@ -192,22 +191,6 @@ } } -static void drc_legacy(const char *dst_path, const char *legacy_path) -{ - conf_native_t *nl = pcb_conf_get_field(legacy_path); - if (nl != NULL) { - gds_t tmp; - - gds_init(&tmp); - pcb_conf_print_native_field((conf_pfn)pcb_append_printf, &tmp, 0, &nl->val, nl->type, nl->prop, 0); - if (tmp.used > 0) - pcb_conf_set(CFR_INTERNAL, dst_path, -1, tmp.array, POL_OVERWRITE); - gds_uninit(&tmp); - } - else - pcb_message(PCB_MSG_ERROR, "drc_query: invalid legacy path '%s' for %s\n", legacy_path, dst_path); -} - static conf_native_t *nat_defs = NULL; static void drc_query_newconf(conf_native_t *cfg, pcb_conf_listitem_t *i) { @@ -249,7 +232,7 @@ pcb_conf_reg_field_(&c, 1, type, path, pcb_strdup(sdesc), 0); if (slegacy != NULL) - drc_legacy(path, slegacy); + pcb_conf_legacy(path, slegacy); else if (sdefault != NULL) pcb_conf_set(CFR_INTERNAL, path, -1, sdefault, POL_OVERWRITE); path = NULL; /* hash key shall not be free'd */