Index: dlg.c =================================================================== --- dlg.c (revision 30292) +++ dlg.c (revision 30293) @@ -127,7 +127,7 @@ } } - path = pcb_concat("plugins/drc_query/rules/", rule, ":0", NULL); + path = pcb_concat(DRC_CONF_PATH_RULES, rule, ":0", NULL); nd = pcb_conf_lht_get_at_mainplug(role, path, 1, 0); if (nd == NULL) { pcb_message(PCB_MSG_ERROR, "Rule %s not found on this role.\n", rule); @@ -347,7 +347,7 @@ return; } - path = pcb_concat("plugins/drc_query/rules/", row->cell[0], ":0", NULL); + path = pcb_concat(DRC_CONF_PATH_RULES, row->cell[0], ":0", NULL); nd = pcb_conf_lht_get_at_mainplug(role, path, 1, 0); if (nd == NULL) { pcb_message(PCB_MSG_ERROR, "internal error: rule not found at %s\n", path); Index: drc_query.c =================================================================== --- drc_query.c (revision 30292) +++ drc_query.c (revision 30293) @@ -57,6 +57,11 @@ const conf_drc_query_t conf_drc_query; #define DRC_QUERY_CONF_FN "drc_query.conf" +#define DRC_CONF_PATH_DISABLE "design/drc_disable/" +#define DRC_CONF_PATH_CONST "design/drc/" +#define DRC_CONF_PATH_RULES "plugins/drc_query/rules/" +#define DRC_CONF_PATH_DEFS "plugins/drc_query/definitions/" + typedef struct { pcb_board_t *pcb; pcb_view_list_t *lst; @@ -202,7 +207,7 @@ static int *drc_get_disable(const char *name) { - char *path = pcb_concat("design/drc_disable/", name, NULL); + char *path = pcb_concat(DRC_CONF_PATH_DISABLE, name, NULL); conf_native_t *nat = pcb_conf_get_field(path); free(path); if ((nat == NULL) || (nat->type != CFN_BOOLEAN)) @@ -244,7 +249,7 @@ static void drc_query_newconf(conf_native_t *cfg, pcb_conf_listitem_t *i) { if (nat_rules == NULL) { - if (strncmp(cfg->hash_path, "plugins/drc_query/rules", 23) == 0) { + if (strncmp(cfg->hash_path, DRC_CONF_PATH_RULES, strlen(DRC_CONF_PATH_RULES)-1) == 0) { nat_rules = cfg; nat_rules->gui_edit_act = "DrcQueryEditRule"; } @@ -251,7 +256,7 @@ } if (nat_defs == NULL) { - if (strncmp(cfg->hash_path, "plugins/drc_query/definitions", 29) != 0) + if (strncmp(cfg->hash_path, DRC_CONF_PATH_DEFS, strlen(DRC_CONF_PATH_DEFS)-1) != 0) return; nat_defs = cfg; } @@ -258,7 +263,7 @@ if (nat_rules == cfg) { lht_node_t *nd = i->prop.src; - char *path = pcb_concat("design/drc_disable/", nd->name, NULL); + char *path = pcb_concat(DRC_CONF_PATH_DISABLE, nd->name, NULL); if (pcb_conf_get_field(path) == NULL) { const char *sdesc; @@ -288,7 +293,7 @@ } else if (nat_defs == cfg) { lht_node_t *nd = i->prop.src; - char *path = pcb_concat("design/drc/", nd->name, NULL); + char *path = pcb_concat(DRC_CONF_PATH_CONST, nd->name, NULL); pcb_coord_t *c; if (pcb_conf_get_field(path) == NULL) {