Index: trunk/scconfig/gen_conf.sh =================================================================== --- trunk/scconfig/gen_conf.sh (revision 30942) +++ trunk/scconfig/gen_conf.sh (revision 30943) @@ -78,7 +78,7 @@ flag=substr(desc, RSTART, RLENGTH) sub("[ \t]*" flag "[ \t]*", " ", desc) sub("^@", "",flag) - flag="CFF_" toupper(flag) + flag="RND_CFF_" toupper(flag) if (flags == "") flags = flag else Index: trunk/src/board.c =================================================================== --- trunk/src/board.c (revision 30942) +++ trunk/src/board.c (revision 30943) @@ -86,7 +86,7 @@ for(i = 0; i < PCB_NUM_NETLISTS; i++) pcb_netlist_init(&(ptr->netlist[i])); - pcb_conf_set(CFR_INTERNAL, "design/poly_isle_area", -1, "200000000", POL_OVERWRITE); + pcb_conf_set(CFR_INTERNAL, "design/poly_isle_area", -1, "200000000", RND_POL_OVERWRITE); ptr->RatDraw = pcb_false; Index: trunk/src/brave.c =================================================================== --- trunk/src/brave.c (revision 30942) +++ trunk/src/brave.c (revision 30943) @@ -85,7 +85,7 @@ /* truncate last comma */ gds_truncate(&tmp, gds_len(&tmp)-1); - pcb_conf_set(CFR_CLI, "rc/brave", 0, tmp.array, POL_OVERWRITE); + pcb_conf_set(CFR_CLI, "rc/brave", 0, tmp.array, RND_POL_OVERWRITE); gds_uninit(&tmp); } @@ -185,7 +185,7 @@ /* Copy the config from CLI to USER and flush the file */ static void brave_dialog_save(void *hid_ctx, void *caller_data, pcb_hid_attribute_t *attr) { - pcb_conf_set(CFR_USER, "rc/brave", 0, conf_core.rc.brave, POL_OVERWRITE); + pcb_conf_set(CFR_USER, "rc/brave", 0, conf_core.rc.brave, RND_POL_OVERWRITE); if (pcb_conf_isdirty(CFR_USER)) pcb_conf_save_file(&PCB->hidlib, NULL, NULL, CFR_USER, NULL); } Index: trunk/src/conf_core.c =================================================================== --- trunk/src/conf_core.c (revision 30942) +++ trunk/src/conf_core.c (revision 30943) @@ -37,7 +37,7 @@ gds_init(&tmp); pcb_conf_print_native_field((conf_pfn)pcb_append_printf, &tmp, 0, &nlegacy->val, nlegacy->type, nlegacy->prop, 0); if (tmp.used > 0) - pcb_conf_set(CFR_INTERNAL, dst_path, -1, tmp.array, POL_OVERWRITE); + pcb_conf_set(CFR_INTERNAL, dst_path, -1, tmp.array, RND_POL_OVERWRITE); gds_uninit(&tmp); } @@ -74,7 +74,7 @@ for(e = htpp_first(&legacy_new2old); e != NULL; e = htpp_next(&legacy_new2old, e)) { conf_native_t *nlegacy = e->value, *ndst = e->key; - if (nlegacy->pcb_conf_rev > ndst->pcb_conf_rev) + if (nlegacy->rnd_conf_rev > ndst->rnd_conf_rev) pcb_conf_legacy_(ndst, nlegacy); } } Index: trunk/src/file_act.c =================================================================== --- trunk/src/file_act.c (revision 30942) +++ trunk/src/file_act.c (revision 30943) @@ -166,7 +166,7 @@ pcb_draw_inhibit_dec(); pcb_set_design_dir(NULL); - pcb_conf_set(CFR_DESIGN, "design/text_font_id", 0, "0", POL_OVERWRITE); /* we have only one font now, make sure it is selected */ + pcb_conf_set(CFR_DESIGN, "design/text_font_id", 0, "0", RND_POL_OVERWRITE); /* we have only one font now, make sure it is selected */ /* setup the new name and reset some values to default */ free(PCB->hidlib.name); Index: trunk/src/gui_act.c =================================================================== --- trunk/src/gui_act.c (revision 30942) +++ trunk/src/gui_act.c (revision 30943) @@ -112,9 +112,9 @@ if (id == F_SubcID) { /* change the displayed name of subcircuits */ if (argc > 1) - pcb_conf_set(CFR_DESIGN, "editor/subc_id", -1, str_dir, POL_OVERWRITE); + pcb_conf_set(CFR_DESIGN, "editor/subc_id", -1, str_dir, RND_POL_OVERWRITE); else - pcb_conf_set(CFR_DESIGN, "editor/subc_id", -1, "", POL_OVERWRITE); + pcb_conf_set(CFR_DESIGN, "editor/subc_id", -1, "", RND_POL_OVERWRITE); pcb_gui->invalidate_all(pcb_gui); /* doesn't change too often, isn't worth anything more complicated */ pcb_draw(); @@ -123,9 +123,9 @@ if (id == F_TermID) { /* change the displayed name of terminals */ if (argc > 1) - pcb_conf_set(CFR_DESIGN, "editor/term_id", -1, str_dir, POL_OVERWRITE); + pcb_conf_set(CFR_DESIGN, "editor/term_id", -1, str_dir, RND_POL_OVERWRITE); else - pcb_conf_set(CFR_DESIGN, "editor/term_id", -1, "", POL_OVERWRITE); + pcb_conf_set(CFR_DESIGN, "editor/term_id", -1, "", RND_POL_OVERWRITE); pcb_gui->invalidate_all(pcb_gui); /* doesn't change too often, isn't worth anything more complicated */ pcb_draw(); @@ -164,7 +164,7 @@ pcb_hid_notify_crosshair_change(RND_ACT_HIDLIB, pcb_false); pcb_conf_setf(CFR_CLI, "editor/crosshair_shape_idx", 0, "%d", CrosshairShapeIncrement(pcbhl_conf.editor.crosshair_shape_idx)); if (pcb_ch_shape_NUM == pcbhl_conf.editor.crosshair_shape_idx) - pcb_conf_set(CFR_CLI, "editor/crosshair_shape_idx", 0, "0", POL_OVERWRITE); + pcb_conf_set(CFR_CLI, "editor/crosshair_shape_idx", 0, "0", RND_POL_OVERWRITE); pcb_hid_notify_crosshair_change(RND_ACT_HIDLIB, pcb_true); break; @@ -1436,7 +1436,7 @@ tmp[0] = '0' + !conf_core.temp.clip_inhibit_chg; tmp[1] = '\0'; - pcb_conf_set(CFR_CLI, "temp/clip_inhibit_chg", 0, tmp, POL_OVERWRITE); + pcb_conf_set(CFR_CLI, "temp/clip_inhibit_chg", 0, tmp, RND_POL_OVERWRITE); RND_ACT_IRES(0); Index: trunk/src/librnd/core/actions.c =================================================================== --- trunk/src/librnd/core/actions.c (revision 30942) +++ trunk/src/librnd/core/actions.c (revision 30943) @@ -573,9 +573,9 @@ cli_push(pcbhl_conf.rc.cli_backend); cli_push(pcbhl_conf.rc.cli_prompt); - if (pcb_conf_set(CFR_CLI, "rc/cli_backend", 0, backend, POL_OVERWRITE) != 0) + if (pcb_conf_set(CFR_CLI, "rc/cli_backend", 0, backend, RND_POL_OVERWRITE) != 0) return -1; - return pcb_conf_set(CFR_CLI, "rc/cli_prompt", 0, prompt, POL_OVERWRITE); + return pcb_conf_set(CFR_CLI, "rc/cli_prompt", 0, prompt, RND_POL_OVERWRITE); } int rnd_cli_leave(void) @@ -584,15 +584,15 @@ char *prompt = NULL, *backend = NULL; prompt = cli_pop(); backend = cli_pop(); - pcb_conf_set(CFR_CLI, "rc/cli_backend", 0, backend, POL_OVERWRITE); - pcb_conf_set(CFR_CLI, "rc/cli_prompt", 0, prompt, POL_OVERWRITE); + pcb_conf_set(CFR_CLI, "rc/cli_backend", 0, backend, RND_POL_OVERWRITE); + pcb_conf_set(CFR_CLI, "rc/cli_prompt", 0, prompt, RND_POL_OVERWRITE); free(prompt); free(backend); return 0; } - pcb_conf_set(CFR_CLI, "rc/cli_backend", 0, "", POL_OVERWRITE); - pcb_conf_set(CFR_CLI, "rc/cli_prompt", 0, "", POL_OVERWRITE); + pcb_conf_set(CFR_CLI, "rc/cli_backend", 0, "", RND_POL_OVERWRITE); + pcb_conf_set(CFR_CLI, "rc/cli_prompt", 0, "", RND_POL_OVERWRITE); return -1; } Index: trunk/src/librnd/core/conf.c =================================================================== --- trunk/src/librnd/core/conf.c (revision 30942) +++ trunk/src/librnd/core/conf.c (revision 30943) @@ -342,23 +342,23 @@ } -conf_policy_t pcb_conf_policy_parse(const char *s) +rnd_conf_policy_t pcb_conf_policy_parse(const char *s) { - if (rnd_strcasecmp(s, "overwrite") == 0) return POL_OVERWRITE; - if (rnd_strcasecmp(s, "prepend") == 0) return POL_PREPEND; - if (rnd_strcasecmp(s, "append") == 0) return POL_APPEND; - if (rnd_strcasecmp(s, "disable") == 0) return POL_DISABLE; - return POL_invalid; + if (rnd_strcasecmp(s, "overwrite") == 0) return RND_POL_OVERWRITE; + if (rnd_strcasecmp(s, "prepend") == 0) return RND_POL_PREPEND; + if (rnd_strcasecmp(s, "append") == 0) return RND_POL_APPEND; + if (rnd_strcasecmp(s, "disable") == 0) return RND_POL_DISABLE; + return RND_POL_invalid; } -const char *pcb_conf_policy_name(conf_policy_t p) +const char *pcb_conf_policy_name(rnd_conf_policy_t p) { switch(p) { - case POL_OVERWRITE: return "overwrite"; - case POL_PREPEND: return "prepend"; - case POL_APPEND: return "append"; - case POL_DISABLE: return "disable"; - case POL_invalid: return "(invalid)"; + case RND_POL_OVERWRITE: return "overwrite"; + case RND_POL_PREPEND: return "prepend"; + case RND_POL_APPEND: return "append"; + case RND_POL_DISABLE: return "disable"; + case RND_POL_invalid: return "(invalid)"; } return "(unknown)"; } @@ -398,12 +398,12 @@ } -void pcb_conf_extract_poliprio(lht_node_t *root, conf_policy_t *gpolicy, long *gprio) +void pcb_conf_extract_poliprio(lht_node_t *root, rnd_conf_policy_t *gpolicy, long *gprio) { long len = strlen(root->name), p = -1; char tmp[128]; char *sprio, *end; - conf_policy_t pol; + rnd_conf_policy_t pol; if (len >= sizeof(tmp)) { pcb_hid_cfg_error(root, "Invalid policy-prio '%s', subtree is ignored\n", root->name); @@ -426,7 +426,7 @@ /* convert policy */ pol = pcb_conf_policy_parse(tmp); - if (pol == POL_invalid) { + if (pol == RND_POL_invalid) { pcb_hid_cfg_error(root, "Invalid policy in '%s', subtree is ignored\n", root->name); return; } @@ -438,7 +438,7 @@ } -int pcb_conf_get_policy_prio(lht_node_t *node, conf_policy_t *gpolicy, long *gprio) +int pcb_conf_get_policy_prio(lht_node_t *node, rnd_conf_policy_t *gpolicy, long *gprio) { for(;;node = node->parent) { if (node->parent == node->doc->root) { @@ -503,7 +503,7 @@ return NULL; } -int pcb_conf_parse_text(confitem_t *dst, int idx, conf_native_type_t type, const char *text, lht_node_t *err_node) +int pcb_conf_parse_text(rnd_confitem_t *dst, int idx, conf_native_type_t type, const char *text, lht_node_t *err_node) { const char *strue[] = {"true", "yes", "on", "1", NULL}; const char *sfalse[] = {"false", "no", "off", "0", NULL}; @@ -582,9 +582,9 @@ return 0; } -int pcb_conf_merge_patch_text(conf_native_t *dest, lht_node_t *src, int prio, conf_policy_t pol) +int pcb_conf_merge_patch_text(conf_native_t *dest, lht_node_t *src, int prio, rnd_conf_policy_t pol) { - if ((pol == POL_DISABLE) || (dest->prop[0].prio > prio)) + if ((pol == RND_POL_DISABLE) || (dest->prop[0].prio > prio)) return 0; if (dest->random_flags.read_only) { @@ -596,7 +596,7 @@ dest->prop[0].prio = prio; dest->prop[0].src = src; dest->used = 1; - dest->pcb_conf_rev = pcb_conf_rev; + dest->rnd_conf_rev = rnd_conf_rev; } return 0; } @@ -625,15 +625,15 @@ abort(); /* unhandled type */ } -int pcb_conf_merge_patch_array(conf_native_t *dest, lht_node_t *src_lst, int prio, conf_policy_t pol) +int pcb_conf_merge_patch_array(conf_native_t *dest, lht_node_t *src_lst, int prio, rnd_conf_policy_t pol) { lht_node_t *s; int res, idx, didx, maxpr; - if ((pol == POL_DISABLE) || (pol == POL_invalid)) + if ((pol == RND_POL_DISABLE) || (pol == RND_POL_invalid)) return 0; - if (pol == POL_PREPEND) { + if (pol == RND_POL_PREPEND) { for(s = src_lst->data.list.first, maxpr = 0; s != NULL; s = s->next, maxpr++) ; if (dest->used+maxpr >= dest->array_size) @@ -646,19 +646,19 @@ for(s = src_lst->data.list.first, idx = 0; s != NULL; s = s->next, idx++) { if (s->type == LHT_TEXT) { switch(pol) { - case POL_PREPEND: + case RND_POL_PREPEND: if (idx < maxpr) didx = idx; else didx = dest->array_size+1; /* indicate array full */ break; - case POL_APPEND: + case RND_POL_APPEND: didx = dest->used++; break; - case POL_OVERWRITE: + case RND_POL_OVERWRITE: didx = idx; break; - case POL_DISABLE: case POL_invalid: return 0; /* compiler warning */ + case RND_POL_DISABLE: case RND_POL_invalid: return 0; /* compiler warning */ } /*printf(" didx: %d / %d '%s'\n", didx, dest->array_size, s->data.text.value);*/ if (didx >= dest->array_size) { @@ -683,7 +683,7 @@ return res; } -int pcb_conf_merge_patch_list(conf_native_t *dest, lht_node_t *src_lst, int prio, conf_policy_t pol) +int pcb_conf_merge_patch_list(conf_native_t *dest, lht_node_t *src_lst, int prio, rnd_conf_policy_t pol) { lht_node_t *s, *prev; int res = 0; @@ -690,11 +690,11 @@ pcb_conf_listitem_t *i; switch(pol) { - case POL_DISABLE: - case POL_invalid: + case RND_POL_DISABLE: + case RND_POL_invalid: return 0; - case POL_PREPEND: + case RND_POL_PREPEND: for(s = src_lst->data.list.last; s != NULL; s = prev) { /* because lihata lists are single linked, need to look up the previous node manually; O(N^2) */ if (s != src_lst->data.list.first) @@ -733,7 +733,7 @@ } } break; - case POL_OVERWRITE: + case RND_POL_OVERWRITE: /* overwrite the whole list: make it empty then append new elements */ while((i = pcb_conflist_first(dest->val.list)) != NULL) { pcb_conflist_remove(i); @@ -740,7 +740,7 @@ free(i); } /* fall through */ - case POL_APPEND: + case RND_POL_APPEND: for(s = src_lst->data.list.first; s != NULL; s = s->next) { if ((s->type == LHT_TEXT) || ((s->type == LHT_HASH) && (dest->type == CFN_HLIST))) { i = calloc(sizeof(pcb_conf_listitem_t), 1); @@ -776,7 +776,7 @@ return res; } -int pcb_conf_merge_patch_recurse(lht_node_t *sect, conf_role_t role, int default_prio, conf_policy_t default_policy, const char *path_prefix); +int pcb_conf_merge_patch_recurse(lht_node_t *sect, conf_role_t role, int default_prio, rnd_conf_policy_t default_policy, const char *path_prefix); typedef struct conf_ignore_s { const char *name; @@ -845,7 +845,7 @@ } -int pcb_conf_merge_patch_item(const char *path, lht_node_t *n, conf_role_t role, int default_prio, conf_policy_t default_policy) +int pcb_conf_merge_patch_item(const char *path, lht_node_t *n, conf_role_t role, int default_prio, rnd_conf_policy_t default_policy) { conf_native_t *target = pcb_conf_get_field(path); int res = 0; @@ -891,7 +891,7 @@ /* merge main subtree of a patch */ -int pcb_conf_merge_patch_recurse(lht_node_t *sect, conf_role_t role, int default_prio, conf_policy_t default_policy, const char *path_prefix) +int pcb_conf_merge_patch_recurse(lht_node_t *sect, conf_role_t role, int default_prio, rnd_conf_policy_t default_policy, const char *path_prefix) { lht_dom_iterator_t it; lht_node_t *n; @@ -924,7 +924,7 @@ int pcb_conf_merge_patch(lht_node_t *root, conf_role_t role, long gprio) { - conf_policy_t gpolicy; + rnd_conf_policy_t gpolicy; lht_node_t *n; lht_dom_iterator_t it; @@ -946,7 +946,7 @@ typedef struct { conf_role_t role; long prio; - conf_policy_t policy; + rnd_conf_policy_t policy; lht_node_t *subtree; } merge_subtree_t; @@ -971,7 +971,7 @@ m = vmst_alloc_append(&merge_subtree, 1); m->role = role; m->prio = pcb_conf_default_prio[role]; - m->policy = POL_invalid; + m->policy = RND_POL_invalid; pcb_conf_extract_poliprio(subtree_parent_root, &m->policy, &m->prio); m->subtree = subtree_root; @@ -1058,10 +1058,10 @@ } f->used = 0; - f->pcb_conf_rev = pcb_conf_rev; + f->rnd_conf_rev = rnd_conf_rev; } -int pcb_conf_rev = 0; +int rnd_conf_rev = 0; void pcb_conf_update(const char *path, int arr_idx) { conf_native_t *n; @@ -1118,12 +1118,12 @@ conf_hid_local_cb(n, arr_idx, val_change_post); conf_hid_global_cb(n, arr_idx, val_change_post); } - pcb_conf_rev++; + rnd_conf_rev++; } #define POL_ANY 63 -static lht_node_t *conf_lht_get_first_(lht_node_t *cwd, conf_policy_t pol, int create) +static lht_node_t *conf_lht_get_first_(lht_node_t *cwd, rnd_conf_policy_t pol, int create) { lht_node_t *ov; /* normally the "overwrite" node */ @@ -1140,7 +1140,7 @@ break; } else - pol = POL_OVERWRITE; /* this is what is created by default */ + pol = RND_POL_OVERWRITE; /* this is what is created by default */ if (ov == NULL) { lht_node_t *new_ov; @@ -1176,7 +1176,7 @@ return conf_lht_get_first_(pcb_conf_plug_root[target]->root, POL_ANY, create); } -lht_node_t *pcb_conf_lht_get_first_pol(conf_role_t target, conf_policy_t pol, int create) +lht_node_t *pcb_conf_lht_get_first_pol(conf_role_t target, rnd_conf_policy_t pol, int create) { assert(target != CFR_invalid); assert(target >= 0); @@ -1196,7 +1196,7 @@ r = lht_tree_path_(n->doc, n, lht_path, 1, 0, NULL); if ((r == NULL) && (create)) { - pcb_conf_set_dry(target, conf_path, -1, "", POL_OVERWRITE, 0); + pcb_conf_set_dry(target, conf_path, -1, "", RND_POL_OVERWRITE, 0); r = lht_tree_path_(n->doc, n, lht_path, 1, 0, NULL); } @@ -1294,7 +1294,7 @@ pcb_conf_update(NULL, -1); } -conf_native_t *pcb_conf_reg_field_(void *value, int array_size, conf_native_type_t type, const char *path, const char *desc, conf_flag_t flags) +conf_native_t *pcb_conf_reg_field_(void *value, int array_size, conf_native_type_t type, const char *path, const char *desc, rnd_conf_flag_t flags) { conf_native_t *node; @@ -1395,7 +1395,7 @@ return htsp_get(pcb_conf_fields, path); } -int pcb_conf_set_dry(conf_role_t target, const char *path_, int arr_idx, const char *new_val, conf_policy_t pol, int mkdirp) +int pcb_conf_set_dry(conf_role_t target, const char *path_, int arr_idx, const char *new_val, rnd_conf_policy_t pol, int mkdirp) { char *path, *basename, *next, *last, *sidx; conf_native_t *nat; @@ -1404,7 +1404,7 @@ int idx = -1; /* Remove in overwrite only */ - if ((new_val == NULL) && (pol != POL_OVERWRITE)) + if ((new_val == NULL) && (pol != RND_POL_OVERWRITE)) return -1; if (mkdirp) @@ -1440,11 +1440,11 @@ free(path); return -1; } - if (pol == POL_DISABLE) { + if (pol == RND_POL_DISABLE) { free(path); return 0; } - if ((pol != POL_OVERWRITE) && (idx >= 0)) { + if ((pol != RND_POL_OVERWRITE) && (idx >= 0)) { free(path); return -1; } @@ -1534,7 +1534,7 @@ if (new_val != NULL) nn = lht_dom_node_alloc(LHT_TEXT, ""); - if (pol == POL_OVERWRITE) { + if (pol == RND_POL_OVERWRITE) { if (idx == -1) { /* empty the list so that we insert to an empty list which is overwriting the list */ while(cwd->data.list.first != NULL) @@ -1574,9 +1574,9 @@ } } } - else if ((pol == POL_PREPEND) || (pol == POL_OVERWRITE)) + else if ((pol == RND_POL_PREPEND) || (pol == RND_POL_OVERWRITE)) err = lht_dom_list_insert(cwd, nn); - else if (pol == POL_APPEND) + else if (pol == RND_POL_APPEND) err = lht_dom_list_append(cwd, nn); if (err != LHTE_SUCCESS) { lht_dom_node_free(nn); @@ -1616,7 +1616,7 @@ return 0; } -int pcb_conf_set(conf_role_t target, const char *path, int arr_idx, const char *new_val, conf_policy_t pol) +int pcb_conf_set(conf_role_t target, const char *path, int arr_idx, const char *new_val, rnd_conf_policy_t pol) { int res; res = pcb_conf_set_dry(target, path, arr_idx, new_val, pol, 1); @@ -1629,7 +1629,7 @@ int pcb_conf_del(conf_role_t target, const char *path, int arr_idx) { int res; - res = pcb_conf_set_dry(target, path, arr_idx, NULL, POL_OVERWRITE, 0); + res = pcb_conf_set_dry(target, path, arr_idx, NULL, RND_POL_OVERWRITE, 0); if (res < 0) return res; pcb_conf_update(path, arr_idx); @@ -1665,7 +1665,7 @@ { char *arg = NULL, *op, *s; const char *sc; - conf_policy_t pol = POL_OVERWRITE; + rnd_conf_policy_t pol = RND_POL_OVERWRITE; int ret; if (prefix != NULL) { @@ -1716,8 +1716,8 @@ val = op+1; op--; switch(*op) { - case '+': pol = POL_APPEND; *op = '\0'; break; - case '^': pol = POL_PREPEND; *op = '\0'; break; + case '+': pol = RND_POL_APPEND; *op = '\0'; break; + case '^': pol = RND_POL_PREPEND; *op = '\0'; break; } } } @@ -1767,7 +1767,7 @@ conf_fields_foreach(e) { if ((prefix == NULL) || (strncmp(prefix, e->key, pl) == 0)) { conf_native_t *n = e->value; - if (n->flags & CFF_USAGE) { + if (n->flags & RND_CFF_USAGE) { int kl = strlen(n->hash_path); char *s, *name = malloc(kl+32); const char *sc; @@ -2103,7 +2103,7 @@ } \ } while(0) -int pcb_conf_print_native_field(conf_pfn pfn, void *ctx, int verbose, confitem_t *val, conf_native_type_t type, confprop_t *prop, int idx) +int pcb_conf_print_native_field(conf_pfn pfn, void *ctx, int verbose, rnd_confitem_t *val, conf_native_type_t type, confprop_t *prop, int idx) { int ret = 0; switch(type) { @@ -2160,7 +2160,7 @@ ret += pfn(ctx, "%s I %s[%d] = ", prefix, node->hash_path, n); ret += pcb_conf_print_native_field(pfn, ctx, verbose, &node->val, node->type, node->prop, n); if (verbose) - ret += pfn(ctx, " conf_rev=%d\n", node->pcb_conf_rev); + ret += pfn(ctx, " conf_rev=%d\n", node->rnd_conf_rev); else ret += pfn(ctx, ";"); } @@ -2176,7 +2176,7 @@ ret += pfn(ctx, "%s I %s = ", prefix, node->hash_path); ret += pcb_conf_print_native_field(pfn, ctx, verbose, &node->val, node->type, node->prop, 0); if (verbose) - ret += pfn(ctx, " conf_rev=%d\n", node->pcb_conf_rev); + ret += pfn(ctx, " conf_rev=%d\n", node->rnd_conf_rev); } return ret; } @@ -2232,7 +2232,7 @@ tmp = pcb_strdup_vprintf(fmt, ap); va_end(ap); - pcb_conf_set(role, path, idx, tmp, POL_OVERWRITE); + pcb_conf_set(role, path, idx, tmp, RND_POL_OVERWRITE); free(tmp); } Index: trunk/src/librnd/core/conf.h =================================================================== --- trunk/src/librnd/core/conf.h (revision 30942) +++ trunk/src/librnd/core/conf.h (revision 30943) @@ -24,8 +24,8 @@ * mailing list: pcb-rnd (at) list.repo.hu (send "subscribe") */ -#ifndef PCB_CONF_H -#define PCB_CONF_H +#ifndef RND_CONF_H +#define RND_CONF_H #include #include #include @@ -34,24 +34,24 @@ #include #include -typedef union confitem_u confitem_t ; +typedef union rnd_confitem_u rnd_confitem_t ; typedef struct conf_listitem_s pcb_conf_listitem_t; #include -extern int pcb_conf_rev; /* increased by one each time there's a change in any of the config binaries */ +extern int rnd_conf_rev; /* increased by one each time there's a change in any of the config binaries */ typedef enum { - POL_PREPEND, - POL_APPEND, - POL_OVERWRITE, - POL_DISABLE, - POL_invalid -} conf_policy_t; + RND_POL_PREPEND, + RND_POL_APPEND, + RND_POL_OVERWRITE, + RND_POL_DISABLE, + RND_POL_invalid +} rnd_conf_policy_t; typedef enum { /* bitfield */ - CFF_USAGE = 1 /* settings should be printed in usage help */ -} conf_flag_t; + RND_CFF_USAGE = 1 /* settings should be printed in usage help */ +} rnd_conf_flag_t; typedef const char * CFT_STRING; @@ -77,7 +77,7 @@ CFN_max } conf_native_type_t; -union confitem_u { +union rnd_confitem_u { const char **string; int *boolean; long *integer; @@ -100,7 +100,7 @@ const char *hash_path; /* points to the hash key once its added in the hash (else: NULL) */ int array_size; conf_native_type_t type; - conf_flag_t flags; + rnd_conf_flag_t flags; struct { unsigned io_pcb_no_attrib:1; unsigned read_only:1; /* set by conf_core, has no lihata, should not be overwritten */ @@ -110,10 +110,10 @@ } random_flags; /* hack... persistent flags attached by various plugins */ /* dynamic fields loaded from lihata */ - confitem_t val; /* value is always an array (len 1 for the common case) */ + rnd_confitem_t val; /* value is always an array (len 1 for the common case) */ confprop_t *prop; /* an array of properties allocated as big as val's array */ int used; /* number of items actually used in the arrays */ - int pcb_conf_rev; /* last changed rev */ + int rnd_conf_rev; /* last changed rev */ /* dynamic fields for HIDs storing their data */ vtp0_t hid_data; @@ -125,7 +125,7 @@ struct conf_listitem_s { conf_native_type_t type; - confitem_t val; /* value is always an array (len 1 for the common case) */ + rnd_confitem_t val; /* value is always an array (len 1 for the common case) */ confprop_t prop; /* an array of properties allocated as big as val's array */ const char *name; const char *payload; @@ -186,7 +186,7 @@ void pcb_conf_update(const char *path, int arr_idx); conf_native_t *pcb_conf_get_field(const char *path); -conf_native_t *pcb_conf_reg_field_(void *value, int array_size, conf_native_type_t type, const char *path, const char *desc, conf_flag_t flags); +conf_native_t *pcb_conf_reg_field_(void *value, int array_size, conf_native_type_t type, const char *path, const char *desc, rnd_conf_flag_t flags); void pcb_conf_unreg_field(conf_native_t *field); void pcb_conf_unreg_fields(const char *prefix); @@ -195,7 +195,7 @@ policy pol. Only lists should be indexed. Indexing can be a [n] suffix on path or a non-negative arr_idx. Updates the in-memory binary as well. If new_val is NULL, the selected subtree is removed from the lihata document. */ -int pcb_conf_set(conf_role_t target, const char *path, int arr_idx, const char *new_val, conf_policy_t pol); +int pcb_conf_set(conf_role_t target, const char *path, int arr_idx, const char *new_val, rnd_conf_policy_t pol); /* Remove the subtree of path[arr_idx] in memory-lht role target. Same considerations as in pcb_conf_set. */ @@ -207,7 +207,7 @@ /* Same as pcb_conf_set, but without updating the binary - useful for multiple pcb_conf_set_dry calls and a single all-tree conf_udpate(NULL) for transactions. If mkdirp is non-zero, automatically create the policy subtree if it doesn't exist. */ -int pcb_conf_set_dry(conf_role_t target, const char *path_, int arr_idx, const char *new_val, conf_policy_t pol, int mkdirp); +int pcb_conf_set_dry(conf_role_t target, const char *path_, int arr_idx, const char *new_val, rnd_conf_policy_t pol, int mkdirp); /* Same as pcb_conf_set, but doesn't look up where to set things: change the value of the lihata node backing the native field */ @@ -237,11 +237,11 @@ /* convert type name t type - return CFN_max on error */ conf_native_type_t pcb_conf_native_type_parse(const char *s); -/* convert a policy text to policy value - return POL_invalid on error */ -conf_policy_t pcb_conf_policy_parse(const char *s); +/* convert a policy text to policy value - return RND_POL_invalid on error */ +rnd_conf_policy_t pcb_conf_policy_parse(const char *s); /* Return the name of the policy - always a static string, even for invalid roles */ -const char *pcb_conf_policy_name(conf_policy_t p); +const char *pcb_conf_policy_name(rnd_conf_policy_t p); /* convert a role text to role value - return CFR_invalid on error */ conf_role_t pcb_conf_role_parse(const char *s); @@ -287,7 +287,7 @@ a single element of an array, but prints lists as lists. Returns the sum of conf_pfn call return values - this is usually the number of bytes printed. */ -int pcb_conf_print_native_field(conf_pfn pfn, void *ctx, int verbose, confitem_t *val, conf_native_type_t type, confprop_t *prop, int idx); +int pcb_conf_print_native_field(conf_pfn pfn, void *ctx, int verbose, rnd_confitem_t *val, conf_native_type_t type, confprop_t *prop, int idx); /* Prints the value of a node in a form that is suitable for lihata. Prints full arrays. Returns the sum of conf_pfn call return values - this is @@ -336,10 +336,10 @@ pcb_conf_setf(CFR_DESIGN, path, -1, fmt, new_val) #define conf_set_editor(field, val) \ - pcb_conf_set(CFR_DESIGN, "editor/" #field, -1, val ? "1" : "0", POL_OVERWRITE) + pcb_conf_set(CFR_DESIGN, "editor/" #field, -1, val ? "1" : "0", RND_POL_OVERWRITE) #define conf_set_editor_(sfield, val) \ - pcb_conf_set(CFR_DESIGN, sfield, -1, val ? "1" : "0", POL_OVERWRITE) + pcb_conf_set(CFR_DESIGN, sfield, -1, val ? "1" : "0", RND_POL_OVERWRITE) #define conf_toggle_editor(field) \ conf_set_editor(field, !conf_core.editor.field) @@ -378,7 +378,7 @@ const char *pcb_conf_concat_strlist(const pcb_conflist_t *lst, gds_t *buff, int *inited, char sep); -/* Print usage help for all nodes that have the CFF_USAGE flag and whose +/* Print usage help for all nodes that have the RND_CFF_USAGE flag and whose path starts with prefix (if prefix != NULL) */ void pcb_conf_usage(const char *prefix, void (*print)(const char *name, const char *help)); @@ -396,11 +396,11 @@ /* Determine the policy and priority of a config lihata node; returns 0 on success but may not fill in both values, caller is responsible for initializing them before the call. */ -int pcb_conf_get_policy_prio(lht_node_t *node, conf_policy_t *gpolicy, long *gprio); +int pcb_conf_get_policy_prio(lht_node_t *node, rnd_conf_policy_t *gpolicy, long *gprio); /* Parse text and convert the value into native form and store in one of dst fields depending on type */ -int pcb_conf_parse_text(confitem_t *dst, int idx, conf_native_type_t type, const char *text, lht_node_t *err_node); +int pcb_conf_parse_text(rnd_confitem_t *dst, int idx, conf_native_type_t type, const char *text, lht_node_t *err_node); /* Returns the user configuration file name */ const char *pcb_conf_get_user_conf_name(); @@ -410,7 +410,7 @@ /* Get the first subtree that matches pol within target; allocate new subtree if needed */ -lht_node_t *pcb_conf_lht_get_first_pol(conf_role_t target, conf_policy_t pol, int create); +lht_node_t *pcb_conf_lht_get_first_pol(conf_role_t target, rnd_conf_policy_t pol, int create); /* (un)register a custom config file name (not path, just file name); if intern is not NULL, it is the internal (executable-embedded) Index: trunk/src/librnd/core/conf_act.c =================================================================== --- trunk/src/librnd/core/conf_act.c (revision 30942) +++ trunk/src/librnd/core/conf_act.c (revision 30943) @@ -68,7 +68,7 @@ if ((op == F_Set) || (op == F_Delta)) { const char *path, *val; char valbuff[128]; - conf_policy_t pol = POL_OVERWRITE; + rnd_conf_policy_t pol = RND_POL_OVERWRITE; conf_role_t role = CFR_invalid; int rs; @@ -85,7 +85,7 @@ } if (argc > 5) { pol = pcb_conf_policy_parse(a4); - if (pol == POL_invalid) { + if (pol == RND_POL_invalid) { rnd_message(PCB_MSG_ERROR, "Invalid policy: '%s'", a4); return FGW_ERR_ARG_CONV; } @@ -202,7 +202,7 @@ if (role == CFR_invalid) res = pcb_conf_set_native(n, 0, new_value); else - res = pcb_conf_set(role, a1, -1, new_value, POL_OVERWRITE); + res = pcb_conf_set(role, a1, -1, new_value, RND_POL_OVERWRITE); if (res != 0) { rnd_message(PCB_MSG_ERROR, "Can not toggle '%s': failed to set new value\n", a1); Index: trunk/src/librnd/core/gui_act.c =================================================================== --- trunk/src/librnd/core/gui_act.c (revision 30942) +++ trunk/src/librnd/core/gui_act.c (revision 30943) @@ -115,11 +115,11 @@ rnd_PCB_ACT_MAY_CONVARG(1, FGW_STR, FullScreen, cmd = argv[1].val.str); if ((cmd == NULL) || (rnd_strcasecmp(cmd, "Toggle") == 0)) - pcb_conf_setf(CFR_DESIGN, "editor/fullscreen", -1, "%d", !pcbhl_conf.editor.fullscreen, POL_OVERWRITE); + pcb_conf_setf(CFR_DESIGN, "editor/fullscreen", -1, "%d", !pcbhl_conf.editor.fullscreen, RND_POL_OVERWRITE); else if (rnd_strcasecmp(cmd, "On") == 0) - pcb_conf_set(CFR_DESIGN, "editor/fullscreen", -1, "1", POL_OVERWRITE); + pcb_conf_set(CFR_DESIGN, "editor/fullscreen", -1, "1", RND_POL_OVERWRITE); else if (rnd_strcasecmp(cmd, "Off") == 0) - pcb_conf_set(CFR_DESIGN, "editor/fullscreen", -1, "0", POL_OVERWRITE); + pcb_conf_set(CFR_DESIGN, "editor/fullscreen", -1, "0", RND_POL_OVERWRITE); else RND_ACT_FAIL(FullScreen); Index: trunk/src/librnd/core/hidlib_conf.c =================================================================== --- trunk/src/librnd/core/hidlib_conf.c (revision 30942) +++ trunk/src/librnd/core/hidlib_conf.c (revision 30943) @@ -67,5 +67,5 @@ void pcb_hidlib_set_unit(rnd_hidlib_t *hidlib, const pcb_unit_t *new_unit) { if (new_unit != NULL && new_unit->allow != PCB_UNIT_NO_PRINT) - pcb_conf_set(CFR_DESIGN, "editor/grid_unit", -1, new_unit->suffix, POL_OVERWRITE); + pcb_conf_set(CFR_DESIGN, "editor/grid_unit", -1, new_unit->suffix, RND_POL_OVERWRITE); } Index: trunk/src/librnd/core/tool.c =================================================================== --- trunk/src/librnd/core/tool.c (revision 30942) +++ trunk/src/librnd/core/tool.c (revision 30943) @@ -146,7 +146,7 @@ uninit_current_tool(); sprintf(id_s, "%d", id); tool_select_lock = 1; - pcb_conf_set(CFR_DESIGN, "editor/mode", -1, id_s, POL_OVERWRITE); + pcb_conf_set(CFR_DESIGN, "editor/mode", -1, id_s, RND_POL_OVERWRITE); tool_select_lock = 0; init_current_tool(); Index: trunk/src/librnd/pcb_compat.h =================================================================== --- trunk/src/librnd/pcb_compat.h (revision 30942) +++ trunk/src/librnd/pcb_compat.h (revision 30943) @@ -215,3 +215,14 @@ #define pcb_ltime rnd_ltime #define pcb_dtime rnd_dtime #define pcb_fileno rnd_fileno +#define confitem_t rnd_confitem_t +#define confitem_u rnd_confitem_u +#define pcb_conf_rev rnd_conf_rev +#define conf_policy_t rnd_conf_policy_t +#define POL_PREPEND RND_POL_PREPEND +#define POL_APPEND RND_POL_APPEND +#define POL_OVERWRITE RND_POL_OVERWRITE +#define POL_DISABLE RND_POL_DISABLE +#define POL_invalid RND_POL_invalid +#define conf_flag_t rnd_conf_flag_t +#define CFF_USAGE RND_CFF_USAGE Index: trunk/src/main.c =================================================================== --- trunk/src/main.c (revision 30942) +++ trunk/src/main.c (revision 30943) @@ -427,7 +427,7 @@ pcb_hidlib_init1(conf_core_init); pcb_event_init_app(); - pcb_conf_set(CFR_INTERNAL, "rc/path/exec_prefix", -1, exec_prefix, POL_OVERWRITE); + pcb_conf_set(CFR_INTERNAL, "rc/path/exec_prefix", -1, exec_prefix, RND_POL_OVERWRITE); free(exec_prefix); pcb_layer_vis_init(); Index: trunk/src/plug_io.c =================================================================== --- trunk/src/plug_io.c (revision 30942) +++ trunk/src/plug_io.c (revision 30943) @@ -244,7 +244,7 @@ if (load_settings) pcb_event(&PCB->hidlib, PCB_EVENT_LOAD_POST, "si", Filename, res); pcb_event(&PCB->hidlib, PCB_EVENT_ROUTE_STYLES_CHANGED, NULL); - pcb_conf_set(CFR_DESIGN, "design/text_font_id", 0, "0", POL_OVERWRITE); /* we have only one font now, make sure it is selected */ + pcb_conf_set(CFR_DESIGN, "design/text_font_id", 0, "0", RND_POL_OVERWRITE); /* we have only one font now, make sure it is selected */ pcb_plug_io_err(&Ptr->hidlib, res, "load pcb", Filename); return res; @@ -581,7 +581,7 @@ if (nat == NULL) { const pcb_unit_t *new_unit = get_unit_struct(unit_suffix); if (new_unit) - pcb_conf_set(settings_dest, "editor/grid_unit", -1, unit_suffix, POL_OVERWRITE); + pcb_conf_set(settings_dest, "editor/grid_unit", -1, unit_suffix, RND_POL_OVERWRITE); } } Index: trunk/src_plugins/ddraft/constraint_gui.c =================================================================== --- trunk/src_plugins/ddraft/constraint_gui.c (revision 30942) +++ trunk/src_plugins/ddraft/constraint_gui.c (revision 30943) @@ -190,7 +190,7 @@ cnstgui_ctx.inhibit_confchg++; nv = (cnstgui_ctx.dlg[cnstgui_ctx.alldir].val.lng) ? "1" : "0"; - pcb_conf_set(CFR_DESIGN, "editor/all_direction_lines", -1, nv, POL_OVERWRITE); + pcb_conf_set(CFR_DESIGN, "editor/all_direction_lines", -1, nv, RND_POL_OVERWRITE); cnstgui_ctx.inhibit_confchg--; } Index: trunk/src_plugins/diag/diag.c =================================================================== --- trunk/src_plugins/diag/diag.c (revision 30942) +++ trunk/src_plugins/diag/diag.c (revision 30943) @@ -134,7 +134,7 @@ printf(" Role: %s\n", pcb_conf_role_name(role)); n = pcb_conf_lht_get_at(role, path, 0); if (n != NULL) { - conf_policy_t pol = -1; + rnd_conf_policy_t pol = -1; long prio = pcb_conf_default_prio[role]; Index: trunk/src_plugins/dialogs/dlg_fontsel.c =================================================================== --- trunk/src_plugins/dialogs/dlg_fontsel.c (revision 30942) +++ trunk/src_plugins/dialogs/dlg_fontsel.c (revision 30943) @@ -138,7 +138,7 @@ return; } pcb_del_font(&PCB->fontkit, conf_core.design.text_font_id); - pcb_conf_set(CFR_DESIGN, "design/text_font_id", 0, "0", POL_OVERWRITE); + pcb_conf_set(CFR_DESIGN, "design/text_font_id", 0, "0", RND_POL_OVERWRITE); fontsel_preview_update((fontsel_ctx_t *)caller_data); } Index: trunk/src_plugins/dialogs/dlg_pref.c =================================================================== --- trunk/src_plugins/dialogs/dlg_pref.c (revision 30942) +++ trunk/src_plugins/dialogs/dlg_pref.c (revision 30943) @@ -103,7 +103,7 @@ break; case CFN_STRING: if (strcmp(cn->val.string[0], attr->val.str) != 0) - pcb_conf_set(ctx->role, item->confpath, -1, attr->val.str, POL_OVERWRITE); + pcb_conf_set(ctx->role, item->confpath, -1, attr->val.str, RND_POL_OVERWRITE); break; default: rnd_message(PCB_MSG_ERROR, "pcb_pref_dlg2conf_item(): widget type not handled\n"); } Index: trunk/src_plugins/dialogs/dlg_pref_conf.c =================================================================== --- trunk/src_plugins/dialogs/dlg_pref_conf.c (revision 30942) +++ trunk/src_plugins/dialogs/dlg_pref_conf.c (revision 30943) @@ -151,7 +151,7 @@ if (nat != NULL) { lht_node_t *nd; long prio = pcb_conf_default_prio[n]; - conf_policy_t pol = POL_OVERWRITE; + rnd_conf_policy_t pol = RND_POL_OVERWRITE; nd = pcb_conf_lht_get_at_mainplug(n, nat->hash_path, 1, 0); if (nd != NULL) { /* role, prio, policy, value */ @@ -166,7 +166,7 @@ } } -static const char *print_conf_val(conf_native_type_t type, const confitem_t *val, char *buf, int sizebuf) +static const char *print_conf_val(conf_native_type_t type, const rnd_confitem_t *val, char *buf, int sizebuf) { const char *ret = buf; Index: trunk/src_plugins/dialogs/dlg_pref_confedit.c =================================================================== --- trunk/src_plugins/dialogs/dlg_pref_confedit.c (revision 30942) +++ trunk/src_plugins/dialogs/dlg_pref_confedit.c (revision 30943) @@ -178,7 +178,7 @@ if (val == NULL) val = ""; - pcb_conf_set(ctx->role, ctx->nat->hash_path, ctx->idx, val, POL_OVERWRITE); + pcb_conf_set(ctx->role, ctx->nat->hash_path, ctx->idx, val, RND_POL_OVERWRITE); if ((ctx->role == CFR_USER) || (ctx->role == CFR_PROJECT)) pcb_conf_save_file(&PCB->hidlib, NULL, (PCB == NULL ? NULL : PCB->hidlib.filename), ctx->role, NULL); Index: trunk/src_plugins/dialogs/dlg_pref_lib.c =================================================================== --- trunk/src_plugins/dialogs/dlg_pref_lib.c (revision 30942) +++ trunk/src_plugins/dialogs/dlg_pref_lib.c (revision 30943) @@ -161,7 +161,7 @@ m = pcb_conf_lht_get_first(ctx->role, 0); lst = lht_tree_path_(m->doc, m, "rc/library_search_paths", 1, 0, NULL); if (lst == NULL) - pcb_conf_set(ctx->role, "rc/library_search_paths", 0, "", POL_OVERWRITE); + pcb_conf_set(ctx->role, "rc/library_search_paths", 0, "", RND_POL_OVERWRITE); lst = lht_tree_path_(m->doc, m, "rc/library_search_paths", 1, 0, NULL); assert(lst != NULL); lht_clean_list(lst); Index: trunk/src_plugins/draw_fontsel/draw_fontsel.c =================================================================== --- trunk/src_plugins/draw_fontsel/draw_fontsel.c (revision 30942) +++ trunk/src_plugins/draw_fontsel/draw_fontsel.c (revision 30943) @@ -173,7 +173,7 @@ if (txt == NULL) { char sval[128]; sprintf(sval, "%ld", fid); - pcb_conf_set(CFR_DESIGN, "design/text_font_id", 0, sval, POL_OVERWRITE); + pcb_conf_set(CFR_DESIGN, "design/text_font_id", 0, sval, RND_POL_OVERWRITE); } else { switch(txt->type) { Index: trunk/src_plugins/drc_query/drc_query.c =================================================================== --- trunk/src_plugins/drc_query/drc_query.c (revision 30942) +++ trunk/src_plugins/drc_query/drc_query.c (revision 30943) @@ -280,7 +280,7 @@ nat->random_flags.dyn_desc = 1; nat->random_flags.dyn_val = 1; vtp0_append(&free_drc_conf_nodes, nat); - pcb_conf_set(CFR_INTERNAL, path, -1, "0", POL_OVERWRITE); + pcb_conf_set(CFR_INTERNAL, path, -1, "0", RND_POL_OVERWRITE); } else free(path); @@ -337,7 +337,7 @@ if (slegacy != NULL) pcb_conf_legacy(path, slegacy); else if (sdefault != NULL) - pcb_conf_set(CFR_INTERNAL, path, -1, sdefault, POL_OVERWRITE); + pcb_conf_set(CFR_INTERNAL, path, -1, sdefault, RND_POL_OVERWRITE); path = NULL; /* hash key shall not be free'd */ } fail:; Index: trunk/src_plugins/fontmode/fontmode.c =================================================================== --- trunk/src_plugins/fontmode/fontmode.c (revision 30942) +++ trunk/src_plugins/fontmode/fontmode.c (revision 30943) @@ -115,7 +115,7 @@ if (rnd_actionva(RND_ACT_HIDLIB, "New", "Font", 0)) return 1; - pcb_conf_set(CFR_DESIGN, "editor/grid_unit", -1, "mil", POL_OVERWRITE); + pcb_conf_set(CFR_DESIGN, "editor/grid_unit", -1, "mil", RND_POL_OVERWRITE); conf_set_design("design/min_wid", "%s", "1"); conf_set_design("design/min_slk", "%s", "1"); conf_set_design("design/text_font_id", "%s", "0"); Index: trunk/src_plugins/import_sch2/import_sch.c =================================================================== --- trunk/src_plugins/import_sch2/import_sch.c (revision 30942) +++ trunk/src_plugins/import_sch2/import_sch.c (revision 30943) @@ -65,7 +65,7 @@ src = rnd_attrib_get(PCB, tmp); if (src != NULL) { pcb_conf_grow("plugins/import_sch/args", idx+1); - pcb_conf_set(CFR_DESIGN, "plugins/import_sch/args", idx, src, POL_OVERWRITE); + pcb_conf_set(CFR_DESIGN, "plugins/import_sch/args", idx, src, RND_POL_OVERWRITE); idx++; } } @@ -74,7 +74,7 @@ mode = "gnetlist"; else if (strcmp(mode, "make") == 0) mode = "cmd"; - pcb_conf_set(CFR_DESIGN, "plugins/import_sch/import_fmt", 0, mode, POL_OVERWRITE); + pcb_conf_set(CFR_DESIGN, "plugins/import_sch/import_fmt", 0, mode, RND_POL_OVERWRITE); if (strcmp(mode, "cmd") == 0) { @@ -97,8 +97,8 @@ gds_append_str(&cmdline, target); pcb_conf_grow("plugins/import_sch/args", 2); - pcb_conf_set(CFR_DESIGN, "plugins/import_sch/args", 0, outfile, POL_OVERWRITE); - pcb_conf_set(CFR_DESIGN, "plugins/import_sch/args", 1, cmdline.array, POL_OVERWRITE); + pcb_conf_set(CFR_DESIGN, "plugins/import_sch/args", 0, outfile, RND_POL_OVERWRITE); + pcb_conf_set(CFR_DESIGN, "plugins/import_sch/args", 1, cmdline.array, RND_POL_OVERWRITE); gds_uninit(&cmdline); } @@ -179,10 +179,10 @@ return -1; } - pcb_conf_set(CFR_DESIGN, "plugins/import_sch/import_fmt", 0, argv[0].val.str, POL_OVERWRITE); + pcb_conf_set(CFR_DESIGN, "plugins/import_sch/import_fmt", 0, argv[0].val.str, RND_POL_OVERWRITE); pcb_conf_grow("plugins/import_sch/args", argc-1); for(n = 1; n < argc; n++) - pcb_conf_set(CFR_DESIGN, "plugins/import_sch/args", n-1, argv[n].val.str, POL_OVERWRITE); + pcb_conf_set(CFR_DESIGN, "plugins/import_sch/args", n-1, argv[n].val.str, RND_POL_OVERWRITE); return 0; } Index: trunk/src_plugins/import_sch2/import_sch_dlg.c =================================================================== --- trunk/src_plugins/import_sch2/import_sch_dlg.c (revision 30942) +++ trunk/src_plugins/import_sch2/import_sch_dlg.c (revision 30943) @@ -52,7 +52,7 @@ if (newval == NULL) newval = ""; if (strcmp(ci->val.string[0], newval) != 0) { - pcb_conf_set(CFR_DESIGN, "plugins/import_sch/args", n, newval, POL_OVERWRITE); + pcb_conf_set(CFR_DESIGN, "plugins/import_sch/args", n, newval, RND_POL_OVERWRITE); goto restart; /* elements may be deleted and added with different pointers... */ } } @@ -106,7 +106,7 @@ isch_conf_lock++; PCB_DAD_SET_VALUE(isch_ctx.dlg_hid_ctx, isch_ctx.wtab, lng, target); if (setconf && (p != NULL)) - pcb_conf_set(CFR_DESIGN, "plugins/import_sch/import_fmt", 0, p->name, POL_OVERWRITE); + pcb_conf_set(CFR_DESIGN, "plugins/import_sch/import_fmt", 0, p->name, RND_POL_OVERWRITE); if (p == NULL) { len = 0; @@ -116,7 +116,7 @@ len = pcb_conflist_length((pcb_conflist_t *)&conf_import_sch.plugins.import_sch.args); if (len < 1) { pcb_conf_grow("plugins/import_sch/args", 1); - pcb_conf_set(CFR_DESIGN, "plugins/import_sch/args", 0, "", POL_OVERWRITE); + pcb_conf_set(CFR_DESIGN, "plugins/import_sch/args", 0, "", RND_POL_OVERWRITE); } len = 1; controllable = 0; @@ -182,7 +182,7 @@ if (len < MAX_ARGS+1) { isch_conf_lock++; pcb_conf_grow("plugins/import_sch/args", len+1); - pcb_conf_set(CFR_DESIGN, "plugins/import_sch/args", len, "", POL_OVERWRITE); + pcb_conf_set(CFR_DESIGN, "plugins/import_sch/args", len, "", RND_POL_OVERWRITE); isch_pcb2dlg(); isch_conf_lock--; } @@ -211,7 +211,7 @@ return; isch_conf_lock++; - pcb_conf_set(CFR_DESIGN, "plugins/import_sch/args", idx, name, POL_OVERWRITE); + pcb_conf_set(CFR_DESIGN, "plugins/import_sch/args", idx, name, RND_POL_OVERWRITE); isch_pcb2dlg(); free(name); isch_conf_lock--; @@ -240,7 +240,7 @@ { const char *nv = isch_ctx.dlg[isch_ctx.wverbose].val.lng ? "1" : "0"; isch_conf_lock++; - pcb_conf_set(CFR_DESIGN, "plugins/import_sch/verbose", 0, nv, POL_OVERWRITE); + pcb_conf_set(CFR_DESIGN, "plugins/import_sch/verbose", 0, nv, RND_POL_OVERWRITE); isch_conf_lock--; } Index: trunk/src_plugins/io_eagle/read_dru.c =================================================================== --- trunk/src_plugins/io_eagle/read_dru.c (revision 30942) +++ trunk/src_plugins/io_eagle/read_dru.c (revision 30943) @@ -154,7 +154,7 @@ return; } if (d > curr_val) - pcb_conf_set(CFR_DESIGN, "design/min_drill", -1, val, POL_OVERWRITE); + pcb_conf_set(CFR_DESIGN, "design/min_drill", -1, val, RND_POL_OVERWRITE); } int io_eagle_read_pcb_dru(pcb_plug_io_t *ctx, pcb_board_t *pcb, const char *Filename, conf_role_t settings_dest) @@ -171,9 +171,9 @@ if (f == NULL) return -1; - pcb_conf_set(CFR_DESIGN, "design/bloat", -1, "0", POL_OVERWRITE); - pcb_conf_set(CFR_DESIGN, "design/min_wid", -1, "0", POL_OVERWRITE); - pcb_conf_set(CFR_DESIGN, "design/min_drill", -1, "0", POL_OVERWRITE); + pcb_conf_set(CFR_DESIGN, "design/bloat", -1, "0", RND_POL_OVERWRITE); + pcb_conf_set(CFR_DESIGN, "design/min_wid", -1, "0", RND_POL_OVERWRITE); + pcb_conf_set(CFR_DESIGN, "design/min_drill", -1, "0", RND_POL_OVERWRITE); memcpy(tmp, prefix, sizeof(prefix)); Index: trunk/src_plugins/io_lihata/read.c =================================================================== --- trunk/src_plugins/io_lihata/read.c (revision 30942) +++ trunk/src_plugins/io_lihata/read.c (revision 30943) @@ -384,7 +384,7 @@ return -1; if (cfg_dest != CFR_invalid) - pcb_conf_set(cfg_dest, path, -1, nd->data.text.value, POL_OVERWRITE); + pcb_conf_set(cfg_dest, path, -1, nd->data.text.value, RND_POL_OVERWRITE); return 0; } Index: trunk/src_plugins/io_pcb/attribs.c =================================================================== --- trunk/src_plugins/io_pcb/attribs.c (revision 30942) +++ trunk/src_plugins/io_pcb/attribs.c (revision 30943) @@ -123,12 +123,12 @@ *next = '\0'; next += strlen(LISTSEP); } - pcb_conf_set(CFR_DESIGN, pcb->Attributes.List[n].name + conf_attr_prefix_len, -1, curr, POL_APPEND); + pcb_conf_set(CFR_DESIGN, pcb->Attributes.List[n].name + conf_attr_prefix_len, -1, curr, RND_POL_APPEND); } free(tmp); } else /* assume plain string */ - pcb_conf_set(CFR_DESIGN, pcb->Attributes.List[n].name + conf_attr_prefix_len, -1, pcb->Attributes.List[n].value, POL_OVERWRITE); + pcb_conf_set(CFR_DESIGN, pcb->Attributes.List[n].name + conf_attr_prefix_len, -1, pcb->Attributes.List[n].value, RND_POL_OVERWRITE); } } } Index: trunk/src_plugins/io_pcb/parse_l.c =================================================================== --- trunk/src_plugins/io_pcb/parse_l.c (revision 30942) +++ trunk/src_plugins/io_pcb/parse_l.c (revision 30943) @@ -2776,28 +2776,28 @@ /* overwrite settings from the flags, mark them not-to-save */ pcb_conf_reset(settings_dest, ""); pcb_conf_main_root_replace_cnt[settings_dest]++; - CONF_SET(settings_dest, "plugins/mincut/enable", -1, CONF_BOOL_FLAG(PCB_ENABLEPCB_FLAG_MINCUT, yy_pcb_flags), POL_OVERWRITE); - CONF_SET(settings_dest, "editor/show_number", -1, CONF_BOOL_FLAG(PCB_SHOWNUMBERFLAG, yy_pcb_flags), POL_OVERWRITE); - CONF_SET(settings_dest, "editor/show_drc", -1, CONF_BOOL_FLAG(PCB_SHOWPCB_FLAG_DRC, yy_pcb_flags), POL_OVERWRITE); - CONF_SET(settings_dest, "editor/rubber_band_mode", -1, CONF_BOOL_FLAG(PCB_RUBBERBANDFLAG, yy_pcb_flags), POL_OVERWRITE); - CONF_SET(settings_dest, "editor/auto_drc", -1, CONF_BOOL_FLAG(PCB_AUTOPCB_FLAG_DRC, yy_pcb_flags), POL_OVERWRITE); - CONF_SET(settings_dest, "editor/all_direction_lines", -1, CONF_BOOL_FLAG(PCB_ALLDIRECTIONFLAG, yy_pcb_flags), POL_OVERWRITE); - CONF_SET(settings_dest, "editor/swap_start_direction", -1, CONF_BOOL_FLAG(PCB_SWAPSTARTDIRFLAG, yy_pcb_flags), POL_OVERWRITE); - CONF_SET(settings_dest, "editor/unique_names", -1, CONF_BOOL_FLAG(PCB_UNIQUENAMEFLAG, yy_pcb_flags), POL_OVERWRITE); - CONF_SET(settings_dest, "editor/clear_line", -1, CONF_BOOL_FLAG(PCB_CLEARNEWFLAG, yy_pcb_flags), POL_OVERWRITE); - CONF_SET(settings_dest, "editor/full_poly", -1, CONF_BOOL_FLAG(PCB_NEWPCB_FLAG_FULLPOLY, yy_pcb_flags), POL_OVERWRITE); - CONF_SET(settings_dest, "editor/snap_pin", -1, CONF_BOOL_FLAG(PCB_SNAPPCB_FLAG_PIN, yy_pcb_flags), POL_OVERWRITE); - CONF_SET(settings_dest, "editor/orthogonal_moves", -1, CONF_BOOL_FLAG(PCB_ORTHOMOVEFLAG, yy_pcb_flags), POL_OVERWRITE); - CONF_SET(settings_dest, "editor/live_routing", -1, CONF_BOOL_FLAG(PCB_LIVEROUTEFLAG, yy_pcb_flags), POL_OVERWRITE); - CONF_SET(settings_dest, "editor/lock_names", -1, CONF_BOOL_FLAG(PCB_LOCKNAMESFLAG, yy_pcb_flags), POL_OVERWRITE); - CONF_SET(settings_dest, "editor/only_names", -1, CONF_BOOL_FLAG(PCB_ONLYNAMESFLAG, yy_pcb_flags), POL_OVERWRITE); - CONF_SET(settings_dest, "editor/hide_names", -1, CONF_BOOL_FLAG(PCB_HIDENAMESFLAG, yy_pcb_flags), POL_OVERWRITE); - CONF_SET(settings_dest, "editor/thin_draw", -1, CONF_BOOL_FLAG(PCB_THINDRAWFLAG, yy_pcb_flags), POL_OVERWRITE); - CONF_SET(settings_dest, "editor/thin_draw_poly", -1, CONF_BOOL_FLAG(PCB_THINDRAWPOLYFLAG, yy_pcb_flags), POL_OVERWRITE); - CONF_SET(settings_dest, "editor/local_ref", -1, CONF_BOOL_FLAG(PCB_LOCALREFFLAG, yy_pcb_flags), POL_OVERWRITE); - CONF_SET(settings_dest, "editor/check_planes", -1, CONF_BOOL_FLAG(PCB_CHECKPLANESFLAG, yy_pcb_flags), POL_OVERWRITE); - CONF_SET(settings_dest, "editor/description", -1, CONF_BOOL_FLAG(PCB_DESCRIPTIONFLAG, yy_pcb_flags), POL_OVERWRITE); - CONF_SET(settings_dest, "editor/name_on_pcb", -1, CONF_BOOL_FLAG(PCB_NAMEONPCBFLAG, yy_pcb_flags), POL_OVERWRITE); + CONF_SET(settings_dest, "plugins/mincut/enable", -1, CONF_BOOL_FLAG(PCB_ENABLEPCB_FLAG_MINCUT, yy_pcb_flags), RND_POL_OVERWRITE); + CONF_SET(settings_dest, "editor/show_number", -1, CONF_BOOL_FLAG(PCB_SHOWNUMBERFLAG, yy_pcb_flags), RND_POL_OVERWRITE); + CONF_SET(settings_dest, "editor/show_drc", -1, CONF_BOOL_FLAG(PCB_SHOWPCB_FLAG_DRC, yy_pcb_flags), RND_POL_OVERWRITE); + CONF_SET(settings_dest, "editor/rubber_band_mode", -1, CONF_BOOL_FLAG(PCB_RUBBERBANDFLAG, yy_pcb_flags), RND_POL_OVERWRITE); + CONF_SET(settings_dest, "editor/auto_drc", -1, CONF_BOOL_FLAG(PCB_AUTOPCB_FLAG_DRC, yy_pcb_flags), RND_POL_OVERWRITE); + CONF_SET(settings_dest, "editor/all_direction_lines", -1, CONF_BOOL_FLAG(PCB_ALLDIRECTIONFLAG, yy_pcb_flags), RND_POL_OVERWRITE); + CONF_SET(settings_dest, "editor/swap_start_direction", -1, CONF_BOOL_FLAG(PCB_SWAPSTARTDIRFLAG, yy_pcb_flags), RND_POL_OVERWRITE); + CONF_SET(settings_dest, "editor/unique_names", -1, CONF_BOOL_FLAG(PCB_UNIQUENAMEFLAG, yy_pcb_flags), RND_POL_OVERWRITE); + CONF_SET(settings_dest, "editor/clear_line", -1, CONF_BOOL_FLAG(PCB_CLEARNEWFLAG, yy_pcb_flags), RND_POL_OVERWRITE); + CONF_SET(settings_dest, "editor/full_poly", -1, CONF_BOOL_FLAG(PCB_NEWPCB_FLAG_FULLPOLY, yy_pcb_flags), RND_POL_OVERWRITE); + CONF_SET(settings_dest, "editor/snap_pin", -1, CONF_BOOL_FLAG(PCB_SNAPPCB_FLAG_PIN, yy_pcb_flags), RND_POL_OVERWRITE); + CONF_SET(settings_dest, "editor/orthogonal_moves", -1, CONF_BOOL_FLAG(PCB_ORTHOMOVEFLAG, yy_pcb_flags), RND_POL_OVERWRITE); + CONF_SET(settings_dest, "editor/live_routing", -1, CONF_BOOL_FLAG(PCB_LIVEROUTEFLAG, yy_pcb_flags), RND_POL_OVERWRITE); + CONF_SET(settings_dest, "editor/lock_names", -1, CONF_BOOL_FLAG(PCB_LOCKNAMESFLAG, yy_pcb_flags), RND_POL_OVERWRITE); + CONF_SET(settings_dest, "editor/only_names", -1, CONF_BOOL_FLAG(PCB_ONLYNAMESFLAG, yy_pcb_flags), RND_POL_OVERWRITE); + CONF_SET(settings_dest, "editor/hide_names", -1, CONF_BOOL_FLAG(PCB_HIDENAMESFLAG, yy_pcb_flags), RND_POL_OVERWRITE); + CONF_SET(settings_dest, "editor/thin_draw", -1, CONF_BOOL_FLAG(PCB_THINDRAWFLAG, yy_pcb_flags), RND_POL_OVERWRITE); + CONF_SET(settings_dest, "editor/thin_draw_poly", -1, CONF_BOOL_FLAG(PCB_THINDRAWPOLYFLAG, yy_pcb_flags), RND_POL_OVERWRITE); + CONF_SET(settings_dest, "editor/local_ref", -1, CONF_BOOL_FLAG(PCB_LOCALREFFLAG, yy_pcb_flags), RND_POL_OVERWRITE); + CONF_SET(settings_dest, "editor/check_planes", -1, CONF_BOOL_FLAG(PCB_CHECKPLANESFLAG, yy_pcb_flags), RND_POL_OVERWRITE); + CONF_SET(settings_dest, "editor/description", -1, CONF_BOOL_FLAG(PCB_DESCRIPTIONFLAG, yy_pcb_flags), RND_POL_OVERWRITE); + CONF_SET(settings_dest, "editor/name_on_pcb", -1, CONF_BOOL_FLAG(PCB_NAMEONPCBFLAG, yy_pcb_flags), RND_POL_OVERWRITE); /* don't save this because it is saved manually as PCB::grid::unit */ CONF_NO_ATTRIB("editor/grid_unit"); Index: trunk/src_plugins/io_pcb/parse_l.l =================================================================== --- trunk/src_plugins/io_pcb/parse_l.l (revision 30942) +++ trunk/src_plugins/io_pcb/parse_l.l (revision 30943) @@ -393,28 +393,28 @@ /* overwrite settings from the flags, mark them not-to-save */ pcb_conf_reset(settings_dest, ""); pcb_conf_main_root_replace_cnt[settings_dest]++; - CONF_SET(settings_dest, "plugins/mincut/enable", -1, CONF_BOOL_FLAG(PCB_ENABLEPCB_FLAG_MINCUT, yy_pcb_flags), POL_OVERWRITE); - CONF_SET(settings_dest, "editor/show_number", -1, CONF_BOOL_FLAG(PCB_SHOWNUMBERFLAG, yy_pcb_flags), POL_OVERWRITE); - CONF_SET(settings_dest, "editor/show_drc", -1, CONF_BOOL_FLAG(PCB_SHOWPCB_FLAG_DRC, yy_pcb_flags), POL_OVERWRITE); - CONF_SET(settings_dest, "editor/rubber_band_mode", -1, CONF_BOOL_FLAG(PCB_RUBBERBANDFLAG, yy_pcb_flags), POL_OVERWRITE); - CONF_SET(settings_dest, "editor/auto_drc", -1, CONF_BOOL_FLAG(PCB_AUTOPCB_FLAG_DRC, yy_pcb_flags), POL_OVERWRITE); - CONF_SET(settings_dest, "editor/all_direction_lines", -1, CONF_BOOL_FLAG(PCB_ALLDIRECTIONFLAG, yy_pcb_flags), POL_OVERWRITE); - CONF_SET(settings_dest, "editor/swap_start_direction", -1, CONF_BOOL_FLAG(PCB_SWAPSTARTDIRFLAG, yy_pcb_flags), POL_OVERWRITE); - CONF_SET(settings_dest, "editor/unique_names", -1, CONF_BOOL_FLAG(PCB_UNIQUENAMEFLAG, yy_pcb_flags), POL_OVERWRITE); - CONF_SET(settings_dest, "editor/clear_line", -1, CONF_BOOL_FLAG(PCB_CLEARNEWFLAG, yy_pcb_flags), POL_OVERWRITE); - CONF_SET(settings_dest, "editor/full_poly", -1, CONF_BOOL_FLAG(PCB_NEWPCB_FLAG_FULLPOLY, yy_pcb_flags), POL_OVERWRITE); - CONF_SET(settings_dest, "editor/snap_pin", -1, CONF_BOOL_FLAG(PCB_SNAPPCB_FLAG_PIN, yy_pcb_flags), POL_OVERWRITE); - CONF_SET(settings_dest, "editor/orthogonal_moves", -1, CONF_BOOL_FLAG(PCB_ORTHOMOVEFLAG, yy_pcb_flags), POL_OVERWRITE); - CONF_SET(settings_dest, "editor/live_routing", -1, CONF_BOOL_FLAG(PCB_LIVEROUTEFLAG, yy_pcb_flags), POL_OVERWRITE); - CONF_SET(settings_dest, "editor/lock_names", -1, CONF_BOOL_FLAG(PCB_LOCKNAMESFLAG, yy_pcb_flags), POL_OVERWRITE); - CONF_SET(settings_dest, "editor/only_names", -1, CONF_BOOL_FLAG(PCB_ONLYNAMESFLAG, yy_pcb_flags), POL_OVERWRITE); - CONF_SET(settings_dest, "editor/hide_names", -1, CONF_BOOL_FLAG(PCB_HIDENAMESFLAG, yy_pcb_flags), POL_OVERWRITE); - CONF_SET(settings_dest, "editor/thin_draw", -1, CONF_BOOL_FLAG(PCB_THINDRAWFLAG, yy_pcb_flags), POL_OVERWRITE); - CONF_SET(settings_dest, "editor/thin_draw_poly", -1, CONF_BOOL_FLAG(PCB_THINDRAWPOLYFLAG, yy_pcb_flags), POL_OVERWRITE); - CONF_SET(settings_dest, "editor/local_ref", -1, CONF_BOOL_FLAG(PCB_LOCALREFFLAG, yy_pcb_flags), POL_OVERWRITE); - CONF_SET(settings_dest, "editor/check_planes", -1, CONF_BOOL_FLAG(PCB_CHECKPLANESFLAG, yy_pcb_flags), POL_OVERWRITE); - CONF_SET(settings_dest, "editor/description", -1, CONF_BOOL_FLAG(PCB_DESCRIPTIONFLAG, yy_pcb_flags), POL_OVERWRITE); - CONF_SET(settings_dest, "editor/name_on_pcb", -1, CONF_BOOL_FLAG(PCB_NAMEONPCBFLAG, yy_pcb_flags), POL_OVERWRITE); + CONF_SET(settings_dest, "plugins/mincut/enable", -1, CONF_BOOL_FLAG(PCB_ENABLEPCB_FLAG_MINCUT, yy_pcb_flags), RND_POL_OVERWRITE); + CONF_SET(settings_dest, "editor/show_number", -1, CONF_BOOL_FLAG(PCB_SHOWNUMBERFLAG, yy_pcb_flags), RND_POL_OVERWRITE); + CONF_SET(settings_dest, "editor/show_drc", -1, CONF_BOOL_FLAG(PCB_SHOWPCB_FLAG_DRC, yy_pcb_flags), RND_POL_OVERWRITE); + CONF_SET(settings_dest, "editor/rubber_band_mode", -1, CONF_BOOL_FLAG(PCB_RUBBERBANDFLAG, yy_pcb_flags), RND_POL_OVERWRITE); + CONF_SET(settings_dest, "editor/auto_drc", -1, CONF_BOOL_FLAG(PCB_AUTOPCB_FLAG_DRC, yy_pcb_flags), RND_POL_OVERWRITE); + CONF_SET(settings_dest, "editor/all_direction_lines", -1, CONF_BOOL_FLAG(PCB_ALLDIRECTIONFLAG, yy_pcb_flags), RND_POL_OVERWRITE); + CONF_SET(settings_dest, "editor/swap_start_direction", -1, CONF_BOOL_FLAG(PCB_SWAPSTARTDIRFLAG, yy_pcb_flags), RND_POL_OVERWRITE); + CONF_SET(settings_dest, "editor/unique_names", -1, CONF_BOOL_FLAG(PCB_UNIQUENAMEFLAG, yy_pcb_flags), RND_POL_OVERWRITE); + CONF_SET(settings_dest, "editor/clear_line", -1, CONF_BOOL_FLAG(PCB_CLEARNEWFLAG, yy_pcb_flags), RND_POL_OVERWRITE); + CONF_SET(settings_dest, "editor/full_poly", -1, CONF_BOOL_FLAG(PCB_NEWPCB_FLAG_FULLPOLY, yy_pcb_flags), RND_POL_OVERWRITE); + CONF_SET(settings_dest, "editor/snap_pin", -1, CONF_BOOL_FLAG(PCB_SNAPPCB_FLAG_PIN, yy_pcb_flags), RND_POL_OVERWRITE); + CONF_SET(settings_dest, "editor/orthogonal_moves", -1, CONF_BOOL_FLAG(PCB_ORTHOMOVEFLAG, yy_pcb_flags), RND_POL_OVERWRITE); + CONF_SET(settings_dest, "editor/live_routing", -1, CONF_BOOL_FLAG(PCB_LIVEROUTEFLAG, yy_pcb_flags), RND_POL_OVERWRITE); + CONF_SET(settings_dest, "editor/lock_names", -1, CONF_BOOL_FLAG(PCB_LOCKNAMESFLAG, yy_pcb_flags), RND_POL_OVERWRITE); + CONF_SET(settings_dest, "editor/only_names", -1, CONF_BOOL_FLAG(PCB_ONLYNAMESFLAG, yy_pcb_flags), RND_POL_OVERWRITE); + CONF_SET(settings_dest, "editor/hide_names", -1, CONF_BOOL_FLAG(PCB_HIDENAMESFLAG, yy_pcb_flags), RND_POL_OVERWRITE); + CONF_SET(settings_dest, "editor/thin_draw", -1, CONF_BOOL_FLAG(PCB_THINDRAWFLAG, yy_pcb_flags), RND_POL_OVERWRITE); + CONF_SET(settings_dest, "editor/thin_draw_poly", -1, CONF_BOOL_FLAG(PCB_THINDRAWPOLYFLAG, yy_pcb_flags), RND_POL_OVERWRITE); + CONF_SET(settings_dest, "editor/local_ref", -1, CONF_BOOL_FLAG(PCB_LOCALREFFLAG, yy_pcb_flags), RND_POL_OVERWRITE); + CONF_SET(settings_dest, "editor/check_planes", -1, CONF_BOOL_FLAG(PCB_CHECKPLANESFLAG, yy_pcb_flags), RND_POL_OVERWRITE); + CONF_SET(settings_dest, "editor/description", -1, CONF_BOOL_FLAG(PCB_DESCRIPTIONFLAG, yy_pcb_flags), RND_POL_OVERWRITE); + CONF_SET(settings_dest, "editor/name_on_pcb", -1, CONF_BOOL_FLAG(PCB_NAMEONPCBFLAG, yy_pcb_flags), RND_POL_OVERWRITE); /* don't save this because it is saved manually as PCB::grid::unit */ CONF_NO_ATTRIB("editor/grid_unit"); Index: trunk/src_plugins/io_pcb/parse_y.c =================================================================== --- trunk/src_plugins/io_pcb/parse_y.c (revision 30942) +++ trunk/src_plugins/io_pcb/parse_y.c (revision 30943) @@ -1843,7 +1843,7 @@ { pcb_board_t *pcb_save = PCB; if ((yy_settings_dest != CFR_invalid) && (layer_group_string != NULL)) - pcb_conf_set(yy_settings_dest, "design/groups", -1, layer_group_string, POL_OVERWRITE); + pcb_conf_set(yy_settings_dest, "design/groups", -1, layer_group_string, RND_POL_OVERWRITE); pcb_board_new_postproc(yyPCB, 0); if (layer_group_string == NULL) { if (pcb_layer_improvise(yyPCB, pcb_true) != 0) { @@ -2020,9 +2020,9 @@ yyPCB->hidlib.grid_oy = OU ((yyvsp[-2].measure)); if (yy_settings_dest != CFR_invalid) { if ((yyvsp[-1].integer)) - pcb_conf_set(yy_settings_dest, "editor/draw_grid", -1, "true", POL_OVERWRITE); + pcb_conf_set(yy_settings_dest, "editor/draw_grid", -1, "true", RND_POL_OVERWRITE); else - pcb_conf_set(yy_settings_dest, "editor/draw_grid", -1, "false", POL_OVERWRITE); + pcb_conf_set(yy_settings_dest, "editor/draw_grid", -1, "false", RND_POL_OVERWRITE); } } #line 2029 "parse_y.c" /* yacc.c:1652 */ @@ -2036,9 +2036,9 @@ yyPCB->hidlib.grid_oy = NU ((yyvsp[-2].measure)); if (yy_settings_dest != CFR_invalid) { if ((yyvsp[-1].integer)) - pcb_conf_set(yy_settings_dest, "editor/draw_grid", -1, "true", POL_OVERWRITE); + pcb_conf_set(yy_settings_dest, "editor/draw_grid", -1, "true", RND_POL_OVERWRITE); else - pcb_conf_set(yy_settings_dest, "editor/draw_grid", -1, "false", POL_OVERWRITE); + pcb_conf_set(yy_settings_dest, "editor/draw_grid", -1, "false", RND_POL_OVERWRITE); } } #line 2045 "parse_y.c" /* yacc.c:1652 */ @@ -3354,7 +3354,7 @@ { char tmp[128]; pcb_sprintf(tmp, "%$mm", crd); - pcb_conf_set(CFR_DESIGN, path, -1, tmp, POL_OVERWRITE); + pcb_conf_set(CFR_DESIGN, path, -1, tmp, RND_POL_OVERWRITE); } static void load_meta_float(const char *path, double val) @@ -3361,5 +3361,5 @@ { char tmp[128]; pcb_sprintf(tmp, "%f", val); - pcb_conf_set(CFR_DESIGN, path, -1, tmp, POL_OVERWRITE); + pcb_conf_set(CFR_DESIGN, path, -1, tmp, RND_POL_OVERWRITE); } Index: trunk/src_plugins/io_pcb/parse_y.y =================================================================== --- trunk/src_plugins/io_pcb/parse_y.y (revision 30942) +++ trunk/src_plugins/io_pcb/parse_y.y (revision 30943) @@ -191,7 +191,7 @@ { pcb_board_t *pcb_save = PCB; if ((yy_settings_dest != CFR_invalid) && (layer_group_string != NULL)) - pcb_conf_set(yy_settings_dest, "design/groups", -1, layer_group_string, POL_OVERWRITE); + pcb_conf_set(yy_settings_dest, "design/groups", -1, layer_group_string, RND_POL_OVERWRITE); pcb_board_new_postproc(yyPCB, 0); if (layer_group_string == NULL) { if (pcb_layer_improvise(yyPCB, pcb_true) != 0) { @@ -352,9 +352,9 @@ yyPCB->hidlib.grid_oy = OU ($5); if (yy_settings_dest != CFR_invalid) { if ($6) - pcb_conf_set(yy_settings_dest, "editor/draw_grid", -1, "true", POL_OVERWRITE); + pcb_conf_set(yy_settings_dest, "editor/draw_grid", -1, "true", RND_POL_OVERWRITE); else - pcb_conf_set(yy_settings_dest, "editor/draw_grid", -1, "false", POL_OVERWRITE); + pcb_conf_set(yy_settings_dest, "editor/draw_grid", -1, "false", RND_POL_OVERWRITE); } } ; @@ -367,9 +367,9 @@ yyPCB->hidlib.grid_oy = NU ($5); if (yy_settings_dest != CFR_invalid) { if ($6) - pcb_conf_set(yy_settings_dest, "editor/draw_grid", -1, "true", POL_OVERWRITE); + pcb_conf_set(yy_settings_dest, "editor/draw_grid", -1, "true", RND_POL_OVERWRITE); else - pcb_conf_set(yy_settings_dest, "editor/draw_grid", -1, "false", POL_OVERWRITE); + pcb_conf_set(yy_settings_dest, "editor/draw_grid", -1, "false", RND_POL_OVERWRITE); } } ; @@ -1450,7 +1450,7 @@ { char tmp[128]; pcb_sprintf(tmp, "%$mm", crd); - pcb_conf_set(CFR_DESIGN, path, -1, tmp, POL_OVERWRITE); + pcb_conf_set(CFR_DESIGN, path, -1, tmp, RND_POL_OVERWRITE); } static void load_meta_float(const char *path, double val) @@ -1457,5 +1457,5 @@ { char tmp[128]; pcb_sprintf(tmp, "%f", val); - pcb_conf_set(CFR_DESIGN, path, -1, tmp, POL_OVERWRITE); + pcb_conf_set(CFR_DESIGN, path, -1, tmp, RND_POL_OVERWRITE); } Index: trunk/src_plugins/lib_gtk_common/dlg_topwin.c =================================================================== --- trunk/src_plugins/lib_gtk_common/dlg_topwin.c (revision 30942) +++ trunk/src_plugins/lib_gtk_common/dlg_topwin.c (revision 30943) @@ -252,7 +252,7 @@ static void fullscreen_cb(GtkButton *btn, void *data) { - pcb_conf_setf(CFR_DESIGN, "editor/fullscreen", -1, "%d", !pcbhl_conf.editor.fullscreen, POL_OVERWRITE); + pcb_conf_setf(CFR_DESIGN, "editor/fullscreen", -1, "%d", !pcbhl_conf.editor.fullscreen, RND_POL_OVERWRITE); } /* XPM */ Index: trunk/src_plugins/lib_hid_common/dlg_comm_m.c =================================================================== --- trunk/src_plugins/lib_hid_common/dlg_comm_m.c (revision 30942) +++ trunk/src_plugins/lib_hid_common/dlg_comm_m.c (revision 30943) @@ -276,7 +276,7 @@ res->type = FGW_INT; PCB_DAD_AUTORUN("MayOverwriteFile", dlg, "File overwrite question", NULL, res->val.nat_int); if (dlg[wdontask].val.lng) { - pcb_conf_set(CFR_USER, "plugins/dialogs/file_overwrite_dialog/dont_ask", 0, "1", POL_OVERWRITE); + pcb_conf_set(CFR_USER, "plugins/dialogs/file_overwrite_dialog/dont_ask", 0, "1", RND_POL_OVERWRITE); if (pcb_conf_isdirty(CFR_USER)) pcb_conf_save_file(hidlib, NULL, NULL, CFR_USER, NULL); } Index: trunk/src_plugins/lib_vfs/lib_vfs.c =================================================================== --- trunk/src_plugins/lib_vfs/lib_vfs.c (revision 30942) +++ trunk/src_plugins/lib_vfs/lib_vfs.c (revision 30943) @@ -522,7 +522,7 @@ *isdir = 0; if (wr) - return pcb_conf_set(CFR_DESIGN, path, 0, buff->array, POL_OVERWRITE); + return pcb_conf_set(CFR_DESIGN, path, 0, buff->array, RND_POL_OVERWRITE); else pcb_conf_print_native((conf_pfn)vfs_conf_printf, buff, NULL, 0, nat); Index: trunk/src_plugins/oldactions/oldactions.c =================================================================== --- trunk/src_plugins/oldactions/oldactions.c (revision 30942) +++ trunk/src_plugins/oldactions/oldactions.c (revision 30943) @@ -57,7 +57,7 @@ return; } - pcb_conf_set(role, path, -1, n->val.boolean[0] ? "0" : "1", POL_OVERWRITE); + pcb_conf_set(role, path, -1, n->val.boolean[0] ? "0" : "1", RND_POL_OVERWRITE); } static const char pcb_acts_DumpLibrary[] = "DumpLibrary()"; @@ -208,7 +208,7 @@ */ fgw_error_t pcb_act_EnableVendor(fgw_arg_t *res, int argc, fgw_arg_t *argv) { - pcb_conf_set(CFR_DESIGN, "plugins/vendor/enable", -1, "1", POL_OVERWRITE); + pcb_conf_set(CFR_DESIGN, "plugins/vendor/enable", -1, "1", RND_POL_OVERWRITE); RND_ACT_IRES(0); return 0; } @@ -225,7 +225,7 @@ */ fgw_error_t pcb_act_DisableVendor(fgw_arg_t *res, int argc, fgw_arg_t *argv) { - pcb_conf_set(CFR_DESIGN, "plugins/vendor/enable", -1, "0", POL_OVERWRITE); + pcb_conf_set(CFR_DESIGN, "plugins/vendor/enable", -1, "0", RND_POL_OVERWRITE); RND_ACT_IRES(0); return 0; } Index: trunk/src_plugins/vendordrill/vendor.c =================================================================== --- trunk/src_plugins/vendordrill/vendor.c (revision 30942) +++ trunk/src_plugins/vendordrill/vendor.c (revision 30943) @@ -97,7 +97,7 @@ { char tmp[128]; pcb_sprintf(tmp, "%$mm", crd); - pcb_conf_set(CFR_DESIGN, path, -1, tmp, POL_OVERWRITE); + pcb_conf_set(CFR_DESIGN, path, -1, tmp, RND_POL_OVERWRITE); } static rnd_bool vendorIsSubcMappable(pcb_subc_t *subc); @@ -270,7 +270,7 @@ rnd_message(PCB_MSG_INFO, "Loaded %d vendor drills from %s\n", n_vendor_drills, fname); rnd_message(PCB_MSG_INFO, "Loaded %d RefDes skips, %d Value skips, %d Descr skips\n", n_refdes, n_value, n_descr); - pcb_conf_set(CFR_DESIGN, "plugins/vendor/enable", -1, "0", POL_OVERWRITE); + pcb_conf_set(CFR_DESIGN, "plugins/vendor/enable", -1, "0", RND_POL_OVERWRITE); apply_vendor_map(); if (free_fname) Index: trunk/tests/conf/conftest.c =================================================================== --- trunk/tests/conf/conftest.c (revision 30942) +++ trunk/tests/conf/conftest.c (revision 30943) @@ -158,13 +158,13 @@ pcb_conf_update(NULL, -1); } -conf_policy_t current_policy = POL_OVERWRITE; +rnd_conf_policy_t current_policy = RND_POL_OVERWRITE; conf_role_t current_role = CFR_DESIGN; void cmd_policy(char *arg) { - conf_policy_t np = pcb_conf_policy_parse(arg); - if (np == POL_invalid) + rnd_conf_policy_t np = pcb_conf_policy_parse(arg); + if (np == RND_POL_invalid) rnd_message(PCB_MSG_ERROR, "Invalid/unknown policy: '%s'", arg); else current_policy = np; @@ -205,7 +205,7 @@ void cmd_chpolicy(char *arg) { - conf_policy_t np; + rnd_conf_policy_t np; lht_node_t *first; if (arg == NULL) { @@ -213,7 +213,7 @@ return; } np = pcb_conf_policy_parse(arg); - if (np == POL_invalid) { + if (np == RND_POL_invalid) { rnd_message(PCB_MSG_ERROR, "Invalid integer policy: '%s'", arg); return; } Index: trunk/tests/librnd/librnd_test.c =================================================================== --- trunk/tests/librnd/librnd_test.c (revision 30942) +++ trunk/tests/librnd/librnd_test.c (revision 30943) @@ -33,7 +33,7 @@ n += pcbhl_main_args_add(&ga, argv[n], argv[n+1]); pcb_hidlib_init2(pup_buildins, local_buildins); - pcb_conf_set(CFR_CLI, "editor/view/flip_y", 0, "1", POL_OVERWRITE); + pcb_conf_set(CFR_CLI, "editor/view/flip_y", 0, "1", RND_POL_OVERWRITE); if (pcbhl_main_args_setup1(&ga) != 0) { fprintf(stderr, "setup1 fail\n"); Index: trunk/util/gsch2pcb-rnd/gsch2pcb.c =================================================================== --- trunk/util/gsch2pcb-rnd/gsch2pcb.c (revision 30942) +++ trunk/util/gsch2pcb-rnd/gsch2pcb.c (revision 30943) @@ -120,7 +120,7 @@ const char *suff = loc_str_has_suffix(sch, ".sch", 4); if (suff != NULL) { char *tmp = rnd_strndup(sch, suff - sch); - pcb_conf_set(CFR_CLI, "utils/gsch2pcb_rnd/sch_basename", -1, tmp, POL_OVERWRITE); + pcb_conf_set(CFR_CLI, "utils/gsch2pcb_rnd/sch_basename", -1, tmp, RND_POL_OVERWRITE); free(tmp); } } @@ -164,23 +164,23 @@ if (!strcmp(config, "remove-unfound") || !strcmp(config, "r")) { /* This is default behavior set in header section */ - pcb_conf_set(CFR_CLI, "utils/gsch2pcb_rnd/remove_unfound_elements", -1, "1", POL_OVERWRITE); + pcb_conf_set(CFR_CLI, "utils/gsch2pcb_rnd/remove_unfound_elements", -1, "1", RND_POL_OVERWRITE); return 0; } if (!strcmp(config, "keep-unfound") || !strcmp(config, "k")) { - pcb_conf_set(CFR_CLI, "utils/gsch2pcb_rnd/remove_unfound_elements", -1, "0", POL_OVERWRITE); + pcb_conf_set(CFR_CLI, "utils/gsch2pcb_rnd/remove_unfound_elements", -1, "0", RND_POL_OVERWRITE); return 0; } if (!strcmp(config, "quiet") || !strcmp(config, "q")) { - pcb_conf_set(CFR_CLI, "utils/gsch2pcb_rnd/quiet_mode", -1, "1", POL_OVERWRITE); + pcb_conf_set(CFR_CLI, "utils/gsch2pcb_rnd/quiet_mode", -1, "1", RND_POL_OVERWRITE); return 0; } if (!strcmp(config, "preserve") || !strcmp(config, "p")) { - pcb_conf_set(CFR_CLI, "utils/gsch2pcb_rnd/preserve", -1, "1", POL_OVERWRITE); + pcb_conf_set(CFR_CLI, "utils/gsch2pcb_rnd/preserve", -1, "1", RND_POL_OVERWRITE); return 0; } if (!strcmp(config, "elements-shell") || !strcmp(config, "s")) - pcb_conf_set(CFR_CLI, "rc/library_shell", -1, arg, POL_OVERWRITE); + pcb_conf_set(CFR_CLI, "rc/library_shell", -1, arg, RND_POL_OVERWRITE); else if (!strcmp(config, "elements-dir") || !strcmp(config, "d")) { static int warned = 0; if (!warned) { @@ -187,12 +187,12 @@ rnd_message(PCB_MSG_WARNING, "WARNING: using elements-dir from %s - this overrides the normal pcb-rnd configured library search paths\n", config); warned = 1; } - pcb_conf_set(CFR_CLI, "rc/library_search_paths", -1, arg, POL_PREPEND); + pcb_conf_set(CFR_CLI, "rc/library_search_paths", -1, arg, RND_POL_PREPEND); } else if (!strcmp(config, "output-name") || !strcmp(config, "o")) - pcb_conf_set(CFR_CLI, "utils/gsch2pcb_rnd/sch_basename", -1, arg, POL_OVERWRITE); + pcb_conf_set(CFR_CLI, "utils/gsch2pcb_rnd/sch_basename", -1, arg, RND_POL_OVERWRITE); else if (!strcmp(config, "default-pcb") || !strcmp(config, "P")) - pcb_conf_set(CFR_CLI, "utils/gsch2pcb_rnd/default_pcb", -1, arg, POL_OVERWRITE); + pcb_conf_set(CFR_CLI, "utils/gsch2pcb_rnd/default_pcb", -1, arg, RND_POL_OVERWRITE); else if (!strcmp(config, "schematics")) add_multiple_schematics(arg); else if (!strcmp(config, "gnetlist")) { @@ -202,7 +202,7 @@ gadl_append(&extra_gnetlist_list, n); } else if (!strcmp(config, "empty-footprint")) - pcb_conf_set(CFR_CLI, "utils/gsch2pcb_rnd/empty_footprint_name", -1, arg, POL_OVERWRITE); + pcb_conf_set(CFR_CLI, "utils/gsch2pcb_rnd/empty_footprint_name", -1, arg, RND_POL_OVERWRITE); else return -1; @@ -298,7 +298,7 @@ else if (!strcmp(opt, "verbose") || !strcmp(opt, "v")) { char tmp[64]; sprintf(tmp, "%ld", conf_g2pr.utils.gsch2pcb_rnd.verbose + 1); - pcb_conf_set(CFR_CLI, "utils/gsch2pcb_rnd/verbose", -1, tmp, POL_OVERWRITE); + pcb_conf_set(CFR_CLI, "utils/gsch2pcb_rnd/verbose", -1, tmp, RND_POL_OVERWRITE); continue; } else if (!strcmp(opt, "m") || !strcmp(opt, "method")) { @@ -306,7 +306,7 @@ rnd_message(PCB_MSG_ERROR, "Error: can't use unknown method '%s'; try --help\n", arg); exit(1); } - pcb_conf_set(CFR_CLI, "utils/gsch2pcb_rnd/method", -1, arg, POL_OVERWRITE); + pcb_conf_set(CFR_CLI, "utils/gsch2pcb_rnd/method", -1, arg, RND_POL_OVERWRITE); i++; continue; } @@ -320,7 +320,7 @@ continue; } else if (!strcmp(opt, "fix-elements")) { - pcb_conf_set(CFR_CLI, "utils/gsch2pcb_rnd/fix_elements", -1, "1", POL_OVERWRITE); + pcb_conf_set(CFR_CLI, "utils/gsch2pcb_rnd/fix_elements", -1, "1", RND_POL_OVERWRITE); continue; } else if (!strcmp(opt, "gnetlist-arg")) {