Index: trunk/doc/TODO.cleanup =================================================================== --- trunk/doc/TODO.cleanup (revision 26976) +++ trunk/doc/TODO.cleanup (nonexistent) @@ -1,2 +0,0 @@ -- rename: - - conf_* Index: trunk/src/actions.c =================================================================== --- trunk/src/actions.c (revision 26976) +++ trunk/src/actions.c (revision 26977) @@ -556,9 +556,9 @@ cli_push(pcbhl_conf.rc.cli_backend); cli_push(pcbhl_conf.rc.cli_prompt); - if (conf_set(CFR_CLI, "rc/cli_backend", 0, backend, POL_OVERWRITE) != 0) + if (pcb_conf_set(CFR_CLI, "rc/cli_backend", 0, backend, POL_OVERWRITE) != 0) return -1; - return conf_set(CFR_CLI, "rc/cli_prompt", 0, prompt, POL_OVERWRITE); + return pcb_conf_set(CFR_CLI, "rc/cli_prompt", 0, prompt, POL_OVERWRITE); } int pcb_cli_leave(void) @@ -567,15 +567,15 @@ char *prompt = NULL, *backend = NULL; prompt = cli_pop(); backend = cli_pop(); - conf_set(CFR_CLI, "rc/cli_backend", 0, backend, POL_OVERWRITE); - conf_set(CFR_CLI, "rc/cli_prompt", 0, prompt, POL_OVERWRITE); + pcb_conf_set(CFR_CLI, "rc/cli_backend", 0, backend, POL_OVERWRITE); + pcb_conf_set(CFR_CLI, "rc/cli_prompt", 0, prompt, POL_OVERWRITE); free(prompt); free(backend); return 0; } - conf_set(CFR_CLI, "rc/cli_backend", 0, "", POL_OVERWRITE); - conf_set(CFR_CLI, "rc/cli_prompt", 0, "", POL_OVERWRITE); + pcb_conf_set(CFR_CLI, "rc/cli_backend", 0, "", POL_OVERWRITE); + pcb_conf_set(CFR_CLI, "rc/cli_prompt", 0, "", POL_OVERWRITE); return -1; } Index: trunk/src/board.c =================================================================== --- trunk/src/board.c (revision 26976) +++ trunk/src/board.c (revision 26977) @@ -84,7 +84,7 @@ for(i = 0; i < PCB_NUM_NETLISTS; i++) pcb_netlist_init(&(ptr->netlist[i])); - conf_set(CFR_INTERNAL, "design/poly_isle_area", -1, "200000000", POL_OVERWRITE); + pcb_conf_set(CFR_INTERNAL, "design/poly_isle_area", -1, "200000000", POL_OVERWRITE); ptr->RatDraw = pcb_false; Index: trunk/src/brave.c =================================================================== --- trunk/src/brave.c (revision 26976) +++ trunk/src/brave.c (revision 26977) @@ -84,7 +84,7 @@ /* truncate last comma */ gds_truncate(&tmp, gds_len(&tmp)-1); - conf_set(CFR_CLI, "rc/brave", 0, tmp.array, POL_OVERWRITE); + pcb_conf_set(CFR_CLI, "rc/brave", 0, tmp.array, POL_OVERWRITE); gds_uninit(&tmp); } @@ -184,9 +184,9 @@ /* 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) { - conf_set(CFR_USER, "rc/brave", 0, conf_core.rc.brave, POL_OVERWRITE); - if (conf_isdirty(CFR_USER)) - conf_save_file(&PCB->hidlib, NULL, NULL, CFR_USER, NULL); + pcb_conf_set(CFR_USER, "rc/brave", 0, conf_core.rc.brave, POL_OVERWRITE); + if (pcb_conf_isdirty(CFR_USER)) + pcb_conf_save_file(&PCB->hidlib, NULL, NULL, CFR_USER, NULL); } static int brave_interact(void) @@ -284,7 +284,7 @@ void pcb_brave_init(void) { - conf_native_t *n = conf_get_field("rc/brave"); + conf_native_t *n = pcb_conf_get_field("rc/brave"); brave_conf_id = conf_hid_reg(brave_cookie, NULL); if (n != NULL) { Index: trunk/src/conf.c =================================================================== --- trunk/src/conf.c (revision 26976) +++ trunk/src/conf.c (revision 26977) @@ -46,7 +46,7 @@ #include "hidlib.h" /* conf list node's name */ -const char *conf_list_name = "pcb-rnd-conf-v1"; +const char *pcb_conf_list_name = "pcb-rnd-conf-v1"; static const char *flcat = "conf"; /* plugin config files and interns */ @@ -57,24 +57,24 @@ void (*pcb_conf_core_postproc)(void) = NULL; extern void pcbhl_conf_postproc(void); -int conf_in_production = 0; +int pcb_conf_in_production = 0; /* The main conf: monolithic config files affecting all parts of the conf tree; By default every operation is done on these trees. */ -lht_doc_t *conf_main_root[CFR_max_alloc]; -int conf_main_root_lock[CFR_max_alloc]; -int conf_lht_dirty[CFR_max_alloc]; +lht_doc_t *pcb_conf_main_root[CFR_max_alloc]; +int pcb_conf_main_root_lock[CFR_max_alloc]; +int pcb_conf_lht_dirty[CFR_max_alloc]; /* Plugin config: only plugin configuration is accepted; never edited, only merged in. Merge takes two steps: first all files per role are merged into - a single conf_plug_root[R] (lihata level merge), then conf_plug_root[R] + a single pcb_conf_plug_root[R] (lihata level merge), then pcb_conf_plug_root[R] is merged in using the normal conf merge mechanism. Plug roots are merged before main roots so main root overwrite are stronger. */ -lht_doc_t *conf_plug_root[CFR_max_alloc]; +lht_doc_t *pcb_conf_plug_root[CFR_max_alloc]; -htsp_t *conf_fields = NULL; -const int conf_default_prio[] = { +htsp_t *pcb_conf_fields = NULL; +const int pcb_conf_default_prio[] = { /* CFR_INTERNAL */ 100, /* CFR_SYSTEM */ 200, /* CFR_DEFAULTPCB */ 300, @@ -95,7 +95,7 @@ return NULL; /* if it's a list with a matching name, we found it */ - if ((cwd->type == LHT_LIST) && (strcmp(cwd->name, conf_list_name) == 0)) + if ((cwd->type == LHT_LIST) && (strcmp(cwd->name, pcb_conf_list_name) == 0)) return cwd; /* else it may be the parent-hash of the list */ @@ -102,10 +102,10 @@ if (cwd->type != LHT_HASH) return NULL; - return lht_dom_hash_get(cwd, conf_list_name); + return lht_dom_hash_get(cwd, pcb_conf_list_name); } -int conf_insert_tree_as(conf_role_t role, lht_node_t *root) +int pcb_conf_insert_tree_as(conf_role_t role, lht_node_t *root) { lht_doc_t *d; @@ -112,9 +112,9 @@ if ((root->type != LHT_LIST) || (strcmp(root->name, "pcb-rnd-conf-v1") != 0)) return -1; - if (conf_main_root[role] != NULL) { - lht_dom_uninit(conf_main_root[role]); - conf_main_root[role] = NULL; + if (pcb_conf_main_root[role] != NULL) { + lht_dom_uninit(pcb_conf_main_root[role]); + pcb_conf_main_root[role] = NULL; } d = lht_dom_init(); @@ -121,7 +121,7 @@ d->root = lht_dom_node_alloc(LHT_LIST, "pcb-rnd-conf-v1"); d->root->doc = d; lht_tree_merge(d->root, root); - conf_main_root[role] = d; + pcb_conf_main_root[role] = d; return 0; } @@ -159,16 +159,16 @@ return d; } -int conf_load_as(conf_role_t role, const char *fn, int fn_is_text) +int pcb_conf_load_as(conf_role_t role, const char *fn, int fn_is_text) { lht_doc_t *d; - const char *ifn, *role_name = conf_role_name(role); + const char *ifn, *role_name = pcb_conf_role_name(role); - if (conf_main_root_lock[role]) + if (pcb_conf_main_root_lock[role]) return -1; - if (conf_main_root[role] != NULL) { - lht_dom_uninit(conf_main_root[role]); - conf_main_root[role] = NULL; + if (pcb_conf_main_root[role] != NULL) { + lht_dom_uninit(pcb_conf_main_root[role]); + pcb_conf_main_root[role] = NULL; if (role_name != NULL) pcb_file_loaded_del_at(flcat, role_name); } @@ -202,7 +202,7 @@ prjroot->doc = d; confroot->doc = d; d->root = prjroot; - conf_main_root[role] = d; + pcb_conf_main_root[role] = d; if (role_name != NULL) pcb_file_loaded_set_at(flcat, role_name, ifn, "project/conf"); return 0; @@ -209,7 +209,7 @@ } if ((d->root->type == LHT_LIST) && (strcmp(d->root->name, "pcb-rnd-conf-v1") == 0)) { - conf_main_root[role] = d; + pcb_conf_main_root[role] = d; if (role_name != NULL) pcb_file_loaded_set_at(flcat, role_name, ifn, "conf"); return 0; @@ -223,7 +223,7 @@ pcb_file_loaded_set_at(flcat, role_name, ifn, "project/conf"); if ((confroot != NULL) && (confroot->type == LHT_LIST) && (strcmp(confroot->name, "li:pcb-rnd-conf-v1") == 0)) { - conf_main_root[role] = d; + pcb_conf_main_root[role] = d; return 0; } @@ -230,7 +230,7 @@ /* project file with no config root */ confroot = lht_dom_node_alloc(LHT_LIST, "pcb-rnd-conf-v1"); lht_dom_hash_put(d->root, confroot); - conf_main_root[role] = d; + pcb_conf_main_root[role] = d; return 0; } @@ -246,12 +246,12 @@ { lht_err_t err; - if (conf_plug_root[role] == NULL) { - conf_plug_root[role] = lht_dom_init(); - conf_plug_root[role]->root = lht_dom_node_alloc(LHT_LIST, "pcb-rnd-conf-v1"); - conf_plug_root[role]->root->doc = conf_plug_root[role]; + if (pcb_conf_plug_root[role] == NULL) { + pcb_conf_plug_root[role] = lht_dom_init(); + pcb_conf_plug_root[role]->root = lht_dom_node_alloc(LHT_LIST, "pcb-rnd-conf-v1"); + pcb_conf_plug_root[role]->root->doc = pcb_conf_plug_root[role]; } - err = lht_tree_merge(conf_plug_root[role]->root, d->root); + err = lht_tree_merge(pcb_conf_plug_root[role]->root, d->root); lht_dom_uninit(d); if (err != 0) { pcb_message(PCB_MSG_ERROR, "Failed to lihata-merge plugin config %s: %s\n", path, lht_err_str(err)); @@ -267,9 +267,9 @@ int dlen, cnt = 0; htsi_entry_t *e; - if (conf_plug_root[role] != NULL) { - lht_dom_uninit(conf_plug_root[role]); - conf_plug_root[role] = NULL; + if (pcb_conf_plug_root[role] != NULL) { + lht_dom_uninit(pcb_conf_plug_root[role]); + pcb_conf_plug_root[role] = NULL; } if (!conf_files_inited) return 0; @@ -287,7 +287,7 @@ int res = conf_merge_plug(d, role, path); if (res) { char id[256]; - pcb_snprintf(id, sizeof(id), "%s:%s", conf_role_name(role), fn); + pcb_snprintf(id, sizeof(id), "%s:%s", pcb_conf_role_name(role), fn); pcb_file_loaded_set_at("conf/plugin", id, path, NULL); } cnt += res; @@ -303,9 +303,9 @@ int cnt = 0; htsi_entry_t *e; - if (conf_plug_root[role] != NULL) { - lht_dom_uninit(conf_plug_root[role]); - conf_plug_root[role] = NULL; + if (pcb_conf_plug_root[role] != NULL) { + lht_dom_uninit(pcb_conf_plug_root[role]); + pcb_conf_plug_root[role] = NULL; } if (!conf_files_inited) return 0; @@ -320,7 +320,7 @@ return cnt; } -conf_policy_t conf_policy_parse(const char *s) +conf_policy_t pcb_conf_policy_parse(const char *s) { if (pcb_strcasecmp(s, "overwrite") == 0) return POL_OVERWRITE; if (pcb_strcasecmp(s, "prepend") == 0) return POL_PREPEND; @@ -329,7 +329,7 @@ return POL_invalid; } -const char *conf_policy_name(conf_policy_t p) +const char *pcb_conf_policy_name(conf_policy_t p) { switch(p) { case POL_OVERWRITE: return "overwrite"; @@ -341,7 +341,7 @@ return "(unknown)"; } -conf_role_t conf_role_parse(const char *s) +conf_role_t pcb_conf_role_parse(const char *s) { if (pcb_strcasecmp(s, "internal") == 0) return CFR_INTERNAL; if (pcb_strcasecmp(s, "system") == 0) return CFR_SYSTEM; @@ -354,7 +354,7 @@ return CFR_invalid; } -const char *conf_role_name(conf_role_t r) +const char *pcb_conf_role_name(conf_role_t r) { switch(r) { case CFR_INTERNAL: return "internal"; @@ -376,7 +376,7 @@ } -void conf_extract_poliprio(lht_node_t *root, conf_policy_t *gpolicy, long *gprio) +void pcb_conf_extract_poliprio(lht_node_t *root, conf_policy_t *gpolicy, long *gprio) { long len = strlen(root->name), p = -1; char tmp[128]; @@ -403,7 +403,7 @@ } /* convert policy */ - pol = conf_policy_parse(tmp); + pol = pcb_conf_policy_parse(tmp); if (pol == POL_invalid) { pcb_hid_cfg_error(root, "Invalid policy in '%s', subtree is ignored\n", root->name); return; @@ -416,11 +416,11 @@ } -int conf_get_policy_prio(lht_node_t *node, conf_policy_t *gpolicy, long *gprio) +int pcb_conf_get_policy_prio(lht_node_t *node, conf_policy_t *gpolicy, long *gprio) { for(;;node = node->parent) { if (node->parent == node->doc->root) { - conf_extract_poliprio(node, gpolicy, gprio); + pcb_conf_extract_poliprio(node, gpolicy, gprio); return 0; } if (node->parent == NULL) @@ -428,12 +428,12 @@ } } -const char *conf_get_user_conf_name() +const char *pcb_conf_get_user_conf_name() { return pcphl_conf_user_path; } -const char *conf_get_project_conf_name(const char *project_fn, const char *pcb_fn, const char **try) +const char *pcb_conf_get_project_conf_name(const char *project_fn, const char *pcb_fn, const char **try) { static char res[PCB_PATH_MAX+1]; static const char *project_name = "project.lht"; @@ -481,7 +481,7 @@ return NULL; } -int 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(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}; @@ -560,7 +560,7 @@ return 0; } -int 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, conf_policy_t pol) { if ((pol == POL_DISABLE) || (dest->prop[0].prio > prio)) return 0; @@ -570,11 +570,11 @@ return 0; } - if (conf_parse_text(&dest->val, 0, dest->type, src->data.text.value, src) == 0) { + if (pcb_conf_parse_text(&dest->val, 0, dest->type, src->data.text.value, src) == 0) { dest->prop[0].prio = prio; dest->prop[0].src = src; dest->used = 1; - dest->conf_rev = conf_rev; + dest->pcb_conf_rev = pcb_conf_rev; } return 0; } @@ -602,7 +602,7 @@ abort(); /* unhandled type */ } -int 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, conf_policy_t pol) { lht_node_t *s; int res, idx, didx, maxpr; @@ -644,7 +644,7 @@ break; } - if ((s->data.text.value != NULL) && (conf_parse_text(&dest->val, didx, dest->type, s->data.text.value, s) == 0)) { + if ((s->data.text.value != NULL) && (pcb_conf_parse_text(&dest->val, didx, dest->type, s->data.text.value, s) == 0)) { dest->prop[didx].prio = prio; dest->prop[didx].src = s; if (didx >= dest->used) @@ -660,7 +660,7 @@ return res; } -int 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, conf_policy_t pol) { lht_node_t *s, *prev; int res = 0; @@ -684,7 +684,7 @@ i->val.string = &i->payload; i->prop.prio = prio; i->prop.src = s; - if (conf_parse_text(&i->val, 0, CFN_STRING, s->data.text.value, s) != 0) { + if (pcb_conf_parse_text(&i->val, 0, CFN_STRING, s->data.text.value, s) != 0) { free(i); continue; } @@ -712,7 +712,7 @@ i->val.string = &i->payload; i->prop.prio = prio; i->prop.src = s; - if (conf_parse_text(&i->val, 0, CFN_STRING, s->data.text.value, s) != 0) { + if (pcb_conf_parse_text(&i->val, 0, CFN_STRING, s->data.text.value, s) != 0) { free(i); continue; } @@ -729,7 +729,7 @@ return res; } -int 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, conf_policy_t default_policy, const char *path_prefix); typedef struct conf_ignore_s { const char *name; @@ -798,9 +798,9 @@ } -int 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, conf_policy_t default_policy) { - conf_native_t *target = conf_get_field(path); + conf_native_t *target = pcb_conf_get_field(path); int res = 0; if ((role == CFR_DESIGN) || (role == CFR_PROJECT)) { @@ -813,21 +813,21 @@ if (target == NULL) conf_warn_unknown_paths(path, n); else - conf_merge_patch_text(target, n, default_prio, default_policy); + pcb_conf_merge_patch_text(target, n, default_prio, default_policy); break; case LHT_HASH: if (target == NULL) /* no leaf: another level of structs */ - res |= conf_merge_patch_recurse(n, role, default_prio, default_policy, path); + res |= pcb_conf_merge_patch_recurse(n, role, default_prio, default_policy, path); else /* leaf: pretend it's text so it gets parsed */ - conf_merge_patch_text(target, n, default_prio, default_policy); + pcb_conf_merge_patch_text(target, n, default_prio, default_policy); break; case LHT_LIST: if (target == NULL) conf_warn_unknown_paths(path, n); else if (target->type == CFN_LIST) - res |= conf_merge_patch_list(target, n, default_prio, default_policy); + res |= pcb_conf_merge_patch_list(target, n, default_prio, default_policy); else if (target->array_size > 1) - res |= conf_merge_patch_array(target, n, default_prio, default_policy); + res |= pcb_conf_merge_patch_array(target, n, default_prio, default_policy); else pcb_hid_cfg_error(n, "Attempt to initialize a scalar with a list - this node should be a text node\n"); break; @@ -844,7 +844,7 @@ /* merge main subtree of a patch */ -int 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, conf_policy_t default_policy, const char *path_prefix) { lht_dom_iterator_t it; lht_node_t *n; @@ -870,12 +870,12 @@ memcpy(pathe, n->name, nl); namee = pathe+nl; *namee = '\0'; - res |= conf_merge_patch_item(path, n, role, default_prio, default_policy); + res |= pcb_conf_merge_patch_item(path, n, role, default_prio, default_policy); } return res; } -int conf_merge_patch(lht_node_t *root, conf_role_t role, long gprio) +int pcb_conf_merge_patch(lht_node_t *root, conf_role_t role, long gprio) { conf_policy_t gpolicy; lht_node_t *n; @@ -886,12 +886,12 @@ return -1; } - conf_extract_poliprio(root, &gpolicy, &gprio); + pcb_conf_extract_poliprio(root, &gpolicy, &gprio); /* iterate over all hashes and insert them recursively */ for(n = lht_dom_first(&it, root); n != NULL; n = lht_dom_next(&it)) if (n->type == LHT_HASH) - conf_merge_patch_recurse(n, role, gprio, gpolicy, n->name); + pcb_conf_merge_patch_recurse(n, role, gprio, gpolicy, n->name); return 0; } @@ -923,10 +923,10 @@ m = vmst_alloc_append(&merge_subtree, 1); m->role = role; - m->prio = conf_default_prio[role]; + m->prio = pcb_conf_default_prio[role]; m->policy = POL_invalid; - conf_extract_poliprio(subtree_parent_root, &m->policy, &m->prio); + pcb_conf_extract_poliprio(subtree_parent_root, &m->policy, &m->prio); m->subtree = subtree_root; } @@ -952,7 +952,7 @@ } } -int conf_merge_all(const char *path) +int pcb_conf_merge_all(const char *path) { int n, ret = 0; vmst_truncate(&merge_subtree, 0); @@ -959,13 +959,13 @@ for(n = 0; n < CFR_max_real; n++) { lht_node_t *cr; - if (conf_main_root[n] != NULL) { - cr = conf_lht_get_confroot(conf_main_root[n]->root); + if (pcb_conf_main_root[n] != NULL) { + cr = conf_lht_get_confroot(pcb_conf_main_root[n]->root); if (cr != NULL) conf_merge_all_top(n, path, cr); } - if (conf_plug_root[n] != NULL) { - cr = conf_lht_get_confroot(conf_plug_root[n]->root); + if (pcb_conf_plug_root[n] != NULL) { + cr = conf_lht_get_confroot(pcb_conf_plug_root[n]->root); if (cr != NULL) conf_merge_all_top(n, path, cr); } @@ -974,9 +974,9 @@ qsort(merge_subtree.array, vmst_len(&merge_subtree), sizeof(merge_subtree_t), mst_prio_cmp); for(n = 0; n < vmst_len(&merge_subtree); n++) { if (path != NULL) - ret |= conf_merge_patch_item(path, merge_subtree.array[n].subtree, merge_subtree.array[n].role, merge_subtree.array[n].prio, merge_subtree.array[n].policy); + ret |= pcb_conf_merge_patch_item(path, merge_subtree.array[n].subtree, merge_subtree.array[n].role, merge_subtree.array[n].prio, merge_subtree.array[n].policy); else - ret |= conf_merge_patch(merge_subtree.array[n].subtree, merge_subtree.array[n].role, merge_subtree.array[n].prio); + ret |= pcb_conf_merge_patch(merge_subtree.array[n].subtree, merge_subtree.array[n].role, merge_subtree.array[n].prio); } return ret; } @@ -1010,11 +1010,11 @@ } f->used = 0; - f->conf_rev = conf_rev; + f->pcb_conf_rev = pcb_conf_rev; } -int conf_rev = 0; -void conf_update(const char *path, int arr_idx) +int pcb_conf_rev = 0; +void pcb_conf_update(const char *path, int arr_idx) { conf_native_t *n; @@ -1028,7 +1028,7 @@ } } else { - n = conf_get_field(path); + n = pcb_conf_get_field(path); if (n == NULL) { char *path_, *field; path_ = pcb_strdup(path); @@ -1038,12 +1038,12 @@ if (field != NULL) { arr_idx = atoi(field+1); *field = '\0'; - n = conf_get_field(path_); + n = pcb_conf_get_field(path_); } /* if a valid node is found, update it */ if (n != NULL) - conf_update(path_, arr_idx); + pcb_conf_update(path_, arr_idx); free(path_); return; @@ -1054,7 +1054,7 @@ } /* merge all memory-lht data to memory-bin */ - conf_merge_all(path); + pcb_conf_merge_all(path); if (pcb_conf_core_postproc != NULL) pcb_conf_core_postproc(); pcbhl_conf_postproc(); @@ -1070,7 +1070,7 @@ conf_hid_local_cb(n, arr_idx, val_change_post); conf_hid_global_cb(n, arr_idx, val_change_post); } - conf_rev++; + pcb_conf_rev++; } #define POL_ANY 63 @@ -1088,7 +1088,7 @@ ov = cwd->data.list.first; if (pol != POL_ANY) { for(; ov != NULL; ov = ov->next) - if (conf_policy_parse(ov->name) == pol) + if (pcb_conf_policy_parse(ov->name) == pol) break; } else @@ -1098,7 +1098,7 @@ lht_node_t *new_ov; if (!create) return NULL; - new_ov = lht_dom_node_alloc(LHT_HASH, conf_policy_name(pol)); + new_ov = lht_dom_node_alloc(LHT_HASH, pcb_conf_policy_name(pol)); lht_dom_list_append(cwd, new_ov); ov = new_ov; } @@ -1108,48 +1108,48 @@ return ov; } -lht_node_t *conf_lht_get_first(conf_role_t target, int create) +lht_node_t *pcb_conf_lht_get_first(conf_role_t target, int create) { assert(target != CFR_invalid); assert(target >= 0); assert(target < CFR_max_alloc); - if (conf_main_root[target] == NULL) + if (pcb_conf_main_root[target] == NULL) return NULL; - return conf_lht_get_first_(conf_main_root[target]->root, POL_ANY, create); + return conf_lht_get_first_(pcb_conf_main_root[target]->root, POL_ANY, create); } -lht_node_t *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, conf_policy_t pol, int create) { assert(target != CFR_invalid); assert(target >= 0); assert(target < CFR_max_alloc); - if (conf_main_root[target] == NULL) + if (pcb_conf_main_root[target] == NULL) return NULL; - return conf_lht_get_first_(conf_main_root[target]->root, pol, create); + return conf_lht_get_first_(pcb_conf_main_root[target]->root, pol, create); } static lht_node_t *conf_lht_get_at_(conf_role_t target, const char *conf_path, const char *lht_path, int create) { lht_node_t *n, *r = NULL; - n = conf_lht_get_first(target, create); + n = pcb_conf_lht_get_first(target, create); if (n == NULL) return NULL; r = lht_tree_path_(n->doc, n, lht_path, 1, 0, NULL); if ((r == NULL) && (create)) { - conf_set_dry(target, conf_path, -1, "", POL_OVERWRITE, 0); + pcb_conf_set_dry(target, conf_path, -1, "", POL_OVERWRITE, 0); r = lht_tree_path_(n->doc, n, lht_path, 1, 0, NULL); } return r; } -lht_node_t *conf_lht_get_at(conf_role_t target, const char *path, int create) +lht_node_t *pcb_conf_lht_get_at(conf_role_t target, const char *path, int create) { lht_node_t *r; char *pc, *end; - if (conf_main_root[target] == NULL) { + if (pcb_conf_main_root[target] == NULL) { if (!create) return NULL; - conf_reset(target, ""); + pcb_conf_reset(target, ""); } end = strchr(path, '['); if (end == NULL) { @@ -1169,32 +1169,32 @@ } -void conf_load_all(const char *project_fn, const char *pcb_fn) +void pcb_conf_load_all(const char *project_fn, const char *pcb_fn) { const char *pc, *try; /* the ultimate fallback: all essential values are built in the executable on a low priority */ - conf_load_as(CFR_INTERNAL, conf_internal, 1); + pcb_conf_load_as(CFR_INTERNAL, conf_internal, 1); /* load config files */ - conf_load_as(CFR_SYSTEM, pcbhl_conf_sys_path, 0); - conf_load_as(CFR_USER, pcphl_conf_user_path, 0); - pc = conf_get_project_conf_name(project_fn, pcb_fn, &try); + pcb_conf_load_as(CFR_SYSTEM, pcbhl_conf_sys_path, 0); + pcb_conf_load_as(CFR_USER, pcphl_conf_user_path, 0); + pc = pcb_conf_get_project_conf_name(project_fn, pcb_fn, &try); if (pc != NULL) - conf_load_as(CFR_PROJECT, pc, 0); - conf_merge_all(NULL); + pcb_conf_load_as(CFR_PROJECT, pc, 0); + pcb_conf_merge_all(NULL); /* create the user config (in-memory-lht) if it does not exist on disk; this is needed so if the user makes config changes from the GUI things get saved. */ - if (conf_main_root[CFR_USER] == NULL) - conf_reset(CFR_USER, pcphl_conf_user_path); + if (pcb_conf_main_root[CFR_USER] == NULL) + pcb_conf_reset(CFR_USER, pcphl_conf_user_path); - conf_in_production = 1; + pcb_conf_in_production = 1; } -void conf_load_extra(const char *project_fn, const char *pcb_fn) +void pcb_conf_load_extra(const char *project_fn, const char *pcb_fn) { int cnt; cnt = conf_load_plug_files(CFR_SYSTEM, pcbhl_conf_sysdir_path); @@ -1201,36 +1201,36 @@ cnt += conf_load_plug_files(CFR_USER, pcbhl_conf_userdir_path); cnt += conf_load_plug_interns(CFR_INTERNAL); if (cnt > 0) - conf_merge_all(NULL); + pcb_conf_merge_all(NULL); } -void conf_load_project(const char *project_fn, const char *pcb_fn) +void pcb_conf_load_project(const char *project_fn, const char *pcb_fn) { const char *pc, *try; assert((project_fn != NULL) || (pcb_fn != NULL)); - pc = conf_get_project_conf_name(project_fn, pcb_fn, &try); + pc = pcb_conf_get_project_conf_name(project_fn, pcb_fn, &try); if (pc != NULL) - if (conf_load_as(CFR_PROJECT, pc, 0) != 0) + if (pcb_conf_load_as(CFR_PROJECT, pc, 0) != 0) pc = NULL; if (pc == NULL) - conf_reset(CFR_PROJECT, ""); - conf_update(NULL, -1); + pcb_conf_reset(CFR_PROJECT, ""); + pcb_conf_update(NULL, -1); } -void conf_reg_field_(void *value, int array_size, conf_native_type_t type, const char *path, const char *desc, conf_flag_t flags) +void 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 *node; - if (conf_fields == NULL) { - conf_fields = htsp_alloc(strhash, strkeyeq); - assert(conf_fields != NULL); + if (pcb_conf_fields == NULL) { + pcb_conf_fields = htsp_alloc(strhash, strkeyeq); + assert(pcb_conf_fields != NULL); } assert(array_size >= 1); - assert(htsp_get(conf_fields, path) == NULL); + assert(htsp_get(pcb_conf_fields, path) == NULL); node = calloc(sizeof(conf_native_t), 1); node->array_size = array_size; @@ -1243,10 +1243,10 @@ vtp0_init(&(node->hid_data)); vtp0_init(&(node->hid_callbacks)); - htsp_set(conf_fields, (char *)path, node); + htsp_set(pcb_conf_fields, (char *)path, node); } -void conf_free_native(conf_native_t *node) +void pcb_conf_free_native(conf_native_t *node) { if (node->type == CFN_LIST) { while(conflist_first(node->val.list) != NULL) { @@ -1262,7 +1262,7 @@ free(node); } -void conf_unreg_fields(const char *prefix) +void pcb_conf_unreg_fields(const char *prefix) { int len = strlen(prefix); htsp_entry_t *e; @@ -1271,18 +1271,18 @@ conf_fields_foreach(e) { if (strncmp(e->key, prefix, len) == 0) { - conf_free_native(e->value); - htsp_delentry(conf_fields, e); + pcb_conf_free_native(e->value); + htsp_delentry(pcb_conf_fields, e); } } } -conf_native_t *conf_get_field(const char *path) +conf_native_t *pcb_conf_get_field(const char *path) { - return htsp_get(conf_fields, path); + return htsp_get(pcb_conf_fields, path); } -int 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, conf_policy_t pol, int mkdirp) { char *path, *basename, *next, *last, *sidx; conf_native_t *nat; @@ -1295,7 +1295,7 @@ return -1; if (mkdirp) - conf_lht_get_first_pol(target, pol, 1); + pcb_conf_lht_get_first_pol(target, pol, 1); path = pcb_strdup(path_); sidx = strrchr(path, '['); @@ -1316,7 +1316,7 @@ else if (arr_idx >= 0) idx = arr_idx; - nat = conf_get_field(path); + nat = pcb_conf_get_field(path); if (nat == NULL) { free(path); return -1; @@ -1323,7 +1323,7 @@ } - if (conf_main_root[target] == NULL) { + if (pcb_conf_main_root[target] == NULL) { free(path); return -1; } @@ -1336,7 +1336,7 @@ return -1; } - cwd = conf_lht_get_first_pol(target, pol, 0); + cwd = pcb_conf_lht_get_first_pol(target, pol, 0); if (cwd == NULL) { free(path); return -1; @@ -1343,7 +1343,7 @@ } if (idx >= nat->array_size) { - pcb_message(PCB_MSG_ERROR, "Error: can't conf_set() %s[%d]: %d is beyond the end of the array (%d)\n", path, idx, idx, nat->array_size); + pcb_message(PCB_MSG_ERROR, "Error: can't pcb_conf_set() %s[%d]: %d is beyond the end of the array (%d)\n", path, idx, idx, nat->array_size); free(path); return -1; } @@ -1363,13 +1363,13 @@ if (next != NULL) *next = '\0'; - nn = lht_tree_path_(conf_main_root[target], cwd, last, 1, 0, NULL); + nn = lht_tree_path_(pcb_conf_main_root[target], cwd, last, 1, 0, NULL); if (nn == NULL) { if (new_val == NULL) { free(path); return 0; } - if (conf_main_root_lock[target]) { + if (pcb_conf_main_root_lock[target]) { pcb_message(PCB_MSG_WARNING, "WARNING: can't set config item %s because target in-memory lihata does not have the node and is tree-locked\n", path_); free(path); return -1; @@ -1393,9 +1393,9 @@ else ty = LHT_TEXT; - nn = lht_tree_path_(conf_main_root[target], cwd, basename, 1, 0, NULL); + nn = lht_tree_path_(pcb_conf_main_root[target], cwd, basename, 1, 0, NULL); if (nn == NULL) { - if (conf_main_root_lock[target]) { + if (pcb_conf_main_root_lock[target]) { free(path); return -1; } @@ -1492,39 +1492,39 @@ free(cwd->data.text.value); cwd->data.text.value = pcb_strdup(new_val); - cwd->file_name = conf_main_root[target]->active_file; + cwd->file_name = pcb_conf_main_root[target]->active_file; } else lht_tree_del(cwd); - conf_lht_dirty[target]++; + pcb_conf_lht_dirty[target]++; free(path); return 0; } -int 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, conf_policy_t pol) { int res; - res = conf_set_dry(target, path, arr_idx, new_val, pol, 1); + res = pcb_conf_set_dry(target, path, arr_idx, new_val, pol, 1); if (res < 0) return res; - conf_update(path, arr_idx); + pcb_conf_update(path, arr_idx); return 0; } -int conf_del(conf_role_t target, const char *path, int arr_idx) +int pcb_conf_del(conf_role_t target, const char *path, int arr_idx) { int res; - res = conf_set_dry(target, path, arr_idx, NULL, POL_OVERWRITE, 0); + res = pcb_conf_set_dry(target, path, arr_idx, NULL, POL_OVERWRITE, 0); if (res < 0) return res; - conf_update(path, arr_idx); + pcb_conf_update(path, arr_idx); return 0; } -int conf_set_native(conf_native_t *field, int arr_idx, const char *new_val) +int pcb_conf_set_native(conf_native_t *field, int arr_idx, const char *new_val) { lht_node_t *node; @@ -1541,7 +1541,7 @@ } -int conf_set_from_cli(const char *prefix, const char *arg_, const char *val, const char **why) +int pcb_conf_set_from_cli(const char *prefix, const char *arg_, const char *val, const char **why) { char *arg = NULL, *op, *s; const char *sc; @@ -1583,7 +1583,7 @@ return -1; } if (op == NULL) { - conf_native_t *n = conf_get_field(arg); + conf_native_t *n = pcb_conf_get_field(arg); if ((n == NULL) || (n->type != CFN_BOOLEAN)) { free(arg); *why = "value not specified for non-boolean variable; syntax is path=val"; @@ -1603,8 +1603,8 @@ } /* now that we have a clean path (arg) and a value, try to set the config */ - conf_lht_get_first_pol(CFR_CLI, pol, 1); /* make sure the root for the given policy is created */ - ret = conf_set(CFR_CLI, arg, -1, val, pol); + pcb_conf_lht_get_first_pol(CFR_CLI, pol, 1); /* make sure the root for the given policy is created */ + ret = pcb_conf_set(CFR_CLI, arg, -1, val, pol); if (ret != 0) *why = "invalid config path"; @@ -1612,7 +1612,7 @@ return ret; } -int conf_parse_arguments(const char *prefix, int *argc, char ***argv) +int pcb_conf_parse_arguments(const char *prefix, int *argc, char ***argv) { int n, dst; @@ -1624,9 +1624,9 @@ if (a[0] == '-') a++; if (a[0] == '-') a++; - try_again = conf_set_from_cli(prefix, a, NULL, &why); + try_again = pcb_conf_set_from_cli(prefix, a, NULL, &why); if (try_again && (n < (*argc) - 1)) { - try_again = conf_set_from_cli(prefix, a, (*argv)[n+1], &why); + try_again = pcb_conf_set_from_cli(prefix, a, (*argv)[n+1], &why); if (!try_again) n++; } @@ -1639,7 +1639,7 @@ return 0; } -void conf_usage(const char *prefix, void (*print)(const char *name, const char *help)) +void pcb_conf_usage(const char *prefix, void (*print)(const char *name, const char *help)) { htsp_entry_t *e; int pl = (prefix == NULL ? 0 : strlen(prefix)); @@ -1676,9 +1676,9 @@ } } -int conf_replace_subtree(conf_role_t dst_role, const char *dst_path, conf_role_t src_role, const char *src_path) +int pcb_conf_replace_subtree(conf_role_t dst_role, const char *dst_path, conf_role_t src_role, const char *src_path) { - lht_node_t *dst = conf_lht_get_at(dst_role, dst_path, 1); + lht_node_t *dst = pcb_conf_lht_get_at(dst_role, dst_path, 1); lht_node_t *src, *new_src = NULL; if (src_role == CFR_binary) { @@ -1685,7 +1685,7 @@ char *name; lht_node_t *ch = NULL; int isarr, i; - conf_native_t *n = conf_get_field(src_path); + conf_native_t *n = pcb_conf_get_field(src_path); if (n == NULL) return -1; @@ -1712,7 +1712,7 @@ } } else { - conf_print_native_field((conf_pfn)pcb_append_printf, &s, 0, &n->val, n->type, n->prop+i, i); + pcb_conf_print_native_field((conf_pfn)pcb_append_printf, &s, 0, &n->val, n->type, n->prop+i, i); ch = lht_dom_node_alloc(LHT_TEXT, isarr ? "" : name+1); ch->data.text.value = s.array; if (isarr) @@ -1726,7 +1726,7 @@ src = ch; } else - src = conf_lht_get_at(src_role, src_path, 0); + src = pcb_conf_lht_get_at(src_role, src_path, 0); if ((src == NULL) && (dst != NULL)) { lht_tree_del(dst); @@ -1743,7 +1743,7 @@ if (lht_tree_replace(dst, new_src) != LHTE_SUCCESS) goto err; - conf_lht_dirty[dst_role]++; + pcb_conf_lht_dirty[dst_role]++; lht_tree_del(dst); if (src_role == CFR_binary) @@ -1759,15 +1759,15 @@ } -int conf_save_file(pcb_hidlib_t *hidlib, const char *project_fn, const char *pcb_fn, conf_role_t role, const char *fn) +int pcb_conf_save_file(pcb_hidlib_t *hidlib, const char *project_fn, const char *pcb_fn, conf_role_t role, const char *fn) { int fail = 1; - lht_node_t *r = conf_lht_get_first(role, 0); + lht_node_t *r = pcb_conf_lht_get_first(role, 0); const char *try; char *efn; /* do not save if there's no change */ - if (conf_lht_dirty[role] == 0) + if (pcb_conf_lht_dirty[role] == 0) return 0; if (fn == NULL) { @@ -1776,7 +1776,7 @@ fn = pcphl_conf_user_path; break; case CFR_PROJECT: - fn = conf_get_project_conf_name(project_fn, pcb_fn, &try); + fn = pcb_conf_get_project_conf_name(project_fn, pcb_fn, &try); if (fn == NULL) { pcb_message(PCB_MSG_ERROR, "Error: can not save config to project file: %s does not exist - please create an empty file there first\n", try); return -1; @@ -1823,7 +1823,7 @@ TODO("CONF: a project file needs to be loaded, merged, then written (to preserve non-config nodes)") lht_dom_export(r->doc->root, f, ""); fail = 0; - conf_lht_dirty[role] = 0; + pcb_conf_lht_dirty[role] = 0; fclose(f); } else @@ -1834,9 +1834,9 @@ return fail; } -int conf_export_to_file(pcb_hidlib_t *hidlib, const char *fn, conf_role_t role, const char *conf_path) +int pcb_conf_export_to_file(pcb_hidlib_t *hidlib, const char *fn, conf_role_t role, const char *conf_path) { - lht_node_t *at = conf_lht_get_at(role, conf_path, 0); + lht_node_t *at = pcb_conf_lht_get_at(role, conf_path, 0); lht_err_t r; FILE *f; @@ -1853,7 +1853,7 @@ } -conf_listitem_t *conf_list_first_str(conflist_t *list, const char **item_str, int *idx) +conf_listitem_t *pcb_conf_list_first_str(conflist_t *list, const char **item_str, int *idx) { conf_listitem_t *item_li; item_li = conflist_first(list); @@ -1863,10 +1863,10 @@ *item_str = item_li->val.string[0]; return item_li; } - return conf_list_next_str(item_li, item_str, idx); + return pcb_conf_list_next_str(item_li, item_str, idx); } -conf_listitem_t *conf_list_next_str(conf_listitem_t *item_li, const char **item_str, int *idx) +conf_listitem_t *pcb_conf_list_next_str(conf_listitem_t *item_li, const char **item_str, int *idx) { while((item_li = conflist_next(item_li)) != NULL) { (*idx)++; @@ -1882,7 +1882,7 @@ return item_li; } -const char *conf_concat_strlist(const conflist_t *lst, gds_t *buff, int *inited, char sep) +const char *pcb_conf_concat_strlist(const conflist_t *lst, gds_t *buff, int *inited, char sep) { int n; conf_listitem_t *ci; @@ -1906,53 +1906,53 @@ return buff->array; } -void conf_lock(conf_role_t target) +void pcb_conf_lock(conf_role_t target) { - conf_main_root_lock[target] = 1; + pcb_conf_main_root_lock[target] = 1; } -void conf_unlock(conf_role_t target) +void pcb_conf_unlock(conf_role_t target) { - conf_main_root_lock[target] = 0; + pcb_conf_main_root_lock[target] = 0; } -int conf_islocked(conf_role_t target) +int pcb_conf_islocked(conf_role_t target) { - return conf_main_root_lock[target]; + return pcb_conf_main_root_lock[target]; } -int conf_isdirty(conf_role_t target) +int pcb_conf_isdirty(conf_role_t target) { - return conf_lht_dirty[target]; + return pcb_conf_lht_dirty[target]; } -void conf_makedirty(conf_role_t target) +void pcb_conf_makedirty(conf_role_t target) { - conf_lht_dirty[target]++; + pcb_conf_lht_dirty[target]++; } -conf_role_t conf_lookup_role(const lht_node_t *nd) +conf_role_t pcb_conf_lookup_role(const lht_node_t *nd) { conf_role_t r; for(r = 0; r < CFR_max_real; r++) - if (conf_main_root[r] == nd->doc) + if (pcb_conf_main_root[r] == nd->doc) return r; return CFR_invalid; } -void conf_reset(conf_role_t target, const char *source_fn) +void pcb_conf_reset(conf_role_t target, const char *source_fn) { lht_node_t *n; - if (conf_main_root[target] != NULL) - lht_dom_uninit(conf_main_root[target]); + if (pcb_conf_main_root[target] != NULL) + lht_dom_uninit(pcb_conf_main_root[target]); - conf_main_root[target] = lht_dom_init(); - lht_dom_loc_newfile(conf_main_root[target], source_fn); - conf_main_root[target]->root = lht_dom_node_alloc(LHT_LIST, conf_list_name); - conf_main_root[target]->root->doc = conf_main_root[target]; + pcb_conf_main_root[target] = lht_dom_init(); + lht_dom_loc_newfile(pcb_conf_main_root[target], source_fn); + pcb_conf_main_root[target]->root = lht_dom_node_alloc(LHT_LIST, pcb_conf_list_name); + pcb_conf_main_root[target]->root->doc = pcb_conf_main_root[target]; n = lht_dom_node_alloc(LHT_HASH, "overwrite"); - lht_dom_list_insert(conf_main_root[target]->root, n); + lht_dom_list_insert(pcb_conf_main_root[target]->root, n); } /*****************/ @@ -1980,7 +1980,7 @@ } \ } while(0) -int 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, confitem_t *val, conf_native_type_t type, confprop_t *prop, int idx) { int ret = 0; switch(type) { @@ -1997,7 +1997,7 @@ if (conflist_length(val->list) > 0) { ret += pfn(ctx, "{"); for(n = conflist_first(val->list); n != NULL; n = conflist_next(n)) { - conf_print_native_field(pfn, ctx, verbose, &n->val, n->type, &n->prop, 0); + pcb_conf_print_native_field(pfn, ctx, verbose, &n->val, n->type, &n->prop, 0); ret += pfn(ctx, ";"); } ret += pfn(ctx, "}"); @@ -2022,7 +2022,7 @@ return ret; } -int conf_print_native(conf_pfn pfn, void *ctx, const char * prefix, int verbose, conf_native_t *node) +int pcb_conf_print_native(conf_pfn pfn, void *ctx, const char * prefix, int verbose, conf_native_t *node) { int ret = 0; if ((node->used <= 0) && (!verbose)) @@ -2034,9 +2034,9 @@ for(n = 0; n < node->used; n++) { if (verbose) ret += pfn(ctx, "%s I %s[%d] = ", prefix, node->hash_path, n); - ret += conf_print_native_field(pfn, ctx, verbose, &node->val, node->type, node->prop, 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->conf_rev); + ret += pfn(ctx, " pcb_conf_rev=%d\n", node->pcb_conf_rev); else ret += pfn(ctx, ";"); } @@ -2050,9 +2050,9 @@ else { if (verbose) ret += pfn(ctx, "%s I %s = ", prefix, node->hash_path); - ret += conf_print_native_field(pfn, ctx, verbose, &node->val, node->type, node->prop, 0); + 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->conf_rev); + ret += pfn(ctx, " pcb_conf_rev=%d\n", node->pcb_conf_rev); } return ret; } @@ -2060,17 +2060,17 @@ /****************/ -void conf_init(void) +void pcb_conf_init(void) { - conf_reset(CFR_ENV, ""); - conf_reset(CFR_CLI, ""); - conf_reset(CFR_DESIGN, ""); + pcb_conf_reset(CFR_ENV, ""); + pcb_conf_reset(CFR_CLI, ""); + pcb_conf_reset(CFR_DESIGN, ""); - conf_reset(CFR_file, ""); - conf_reset(CFR_binary, ""); + pcb_conf_reset(CFR_file, ""); + pcb_conf_reset(CFR_binary, ""); } -void conf_uninit(void) +void pcb_conf_uninit(void) { int n; htsp_entry_t *e; @@ -2083,23 +2083,23 @@ conf_pcb_hid_uninit(); for(n = 0; n < CFR_max_alloc; n++) { - if (conf_main_root[n] != NULL) - lht_dom_uninit(conf_main_root[n]); - if (conf_plug_root[n] != NULL) - lht_dom_uninit(conf_plug_root[n]); + if (pcb_conf_main_root[n] != NULL) + lht_dom_uninit(pcb_conf_main_root[n]); + if (pcb_conf_plug_root[n] != NULL) + lht_dom_uninit(pcb_conf_plug_root[n]); } conf_fields_foreach(e) { - conf_free_native(e->value); - htsp_delentry(conf_fields, e); + pcb_conf_free_native(e->value); + htsp_delentry(pcb_conf_fields, e); } - htsp_free(conf_fields); + htsp_free(pcb_conf_fields); vmst_uninit(&merge_subtree); pcb_conf_files_uninit(); } -void conf_setf(conf_role_t role, const char *path, int idx, const char *fmt, ...) +void pcb_conf_setf(conf_role_t role, const char *path, int idx, const char *fmt, ...) { char *tmp; va_list ap; @@ -2108,7 +2108,7 @@ tmp = pcb_strdup_vprintf(fmt, ap); va_end(ap); - conf_set(role, path, idx, tmp, POL_OVERWRITE); + pcb_conf_set(role, path, idx, tmp, POL_OVERWRITE); free(tmp); } @@ -2115,7 +2115,7 @@ int pcb_conf_resolve(pcb_conf_resolve_t *res) { - res->nat = conf_get_field(res->path); + res->nat = pcb_conf_get_field(res->path); if (res->nat == NULL) return 0; if ((res->type != res->nat->type) || (!res->allow_array && (res->nat->array_size > 1))) { @@ -2135,7 +2135,7 @@ void pcb_conf_ro(const char *path) { - conf_native_t *n = conf_get_field(path); + conf_native_t *n = pcb_conf_get_field(path); if (n != NULL) { n->used = 1; n->random_flags.read_only = 1; Index: trunk/src/conf.h =================================================================== --- trunk/src/conf.h (revision 26976) +++ trunk/src/conf.h (revision 26977) @@ -39,7 +39,7 @@ #include "list_conf.h" -extern int conf_rev; /* increased by one each time there's a change in any of the config binaries */ +extern int pcb_conf_rev; /* increased by one each time there's a change in any of the config binaries */ typedef enum { POL_PREPEND, @@ -108,7 +108,7 @@ 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 conf_rev; /* last changed rev */ + int pcb_conf_rev; /* last changed rev */ /* dynamic fields for HIDs storing their data */ vtp0_t hid_data; @@ -144,62 +144,62 @@ CFR_invalid } conf_role_t; -extern const int conf_default_prio[]; +extern const int pcb_conf_default_prio[]; -void conf_init(void); -void conf_uninit(void); +void pcb_conf_init(void); +void pcb_conf_uninit(void); -/* Load all config files from disk into memory-lht and run conf_update to +/* Load all config files from disk into memory-lht and run pcb_conf_update to get the binary representation updated. Called only once, from main.c. Switches the conf system into production mode - new plugins registering new internal files will get special treat after this. */ -void conf_load_all(const char *project_fn, const char *pcb_fn); +void pcb_conf_load_all(const char *project_fn, const char *pcb_fn); -/* Set to 1 after conf_load_all() to indicate that the in-memory conf +/* Set to 1 after pcb_conf_load_all() to indicate that the in-memory conf system is complete; any new plugin registering new conf will need to trigger a refresh */ -extern int conf_in_production; +extern int pcb_conf_in_production; /* Load a file or a string as a role */ -int conf_load_as(conf_role_t role, const char *fn, int fn_is_text); +int pcb_conf_load_as(conf_role_t role, const char *fn, int fn_is_text); /* copy root to be the new config of role; root must be a li:pcb-rnd-conf-v1 return 0 on success and removes/invalidates root */ -int conf_insert_tree_as(conf_role_t role, lht_node_t *root); +int pcb_conf_insert_tree_as(conf_role_t role, lht_node_t *root); /* Load a project file into CFR_PROJECT. Both project_fn and pcb_fn can't be NULL. Leaves an initialized but empty CFR_PROJECT root if no project file was - found. Runs conf_update(NULL); */ -void conf_load_project(const char *project_fn, const char *pcb_fn); + found. Runs pcb_conf_update(NULL); */ +void pcb_conf_load_project(const char *project_fn, const char *pcb_fn); -void conf_load_extra(const char *project_fn, const char *pcb_fn); +void pcb_conf_load_extra(const char *project_fn, const char *pcb_fn); /* Update the binary representation from the memory-lht representation */ -void conf_update(const char *path, int arr_idx); +void pcb_conf_update(const char *path, int arr_idx); -conf_native_t *conf_get_field(const char *path); -void 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_get_field(const char *path); +void pcb_conf_reg_field_(void *value, int array_size, conf_native_type_t type, const char *path, const char *desc, conf_flag_t flags); -void conf_unreg_fields(const char *prefix); +void pcb_conf_unreg_fields(const char *prefix); /* Set the value of path[arr_idx] in memory-lht role target to new_val using 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 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, conf_policy_t pol); /* Remove the subtree of path[arr_idx] in memory-lht role target. Same - considerations as in conf_set. */ -int conf_del(conf_role_t target, const char *path, int arr_idx); + considerations as in pcb_conf_set. */ +int pcb_conf_del(conf_role_t target, const char *path, int arr_idx); -/* Same as conf_set, but without updating the binary - useful for multiple - conf_set_dry calls and a single all-tree conf_udpate(NULL) for transactions. +/* 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 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, conf_policy_t pol, int mkdirp); -/* Same as conf_set, but doesn't look up where to set things: change the value of +/* 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 */ -int conf_set_native(conf_native_t *field, int arr_idx, const char *new_val); +int pcb_conf_set_native(conf_native_t *field, int arr_idx, const char *new_val); /* Process a command line argument arg_ (if val == NULL) or a pair of command line arguments arg_ and val. In the first case assume arg_ has both a config path @@ -207,32 +207,32 @@ is always the value. If prefix is not NULL, the path is prefixed with it. On error always set *why to a const string reason. Returns 0 on success. */ -int conf_set_from_cli(const char *prefix, const char *arg_, const char *val, const char **why); +int pcb_conf_set_from_cli(const char *prefix, const char *arg_, const char *val, const char **why); -/* Attempt to consume argv[] using conf_set_from_cli */ -int conf_parse_arguments(const char *prefix, int *argc, char ***argv); +/* Attempt to consume argv[] using pcb_conf_set_from_cli */ +int pcb_conf_parse_arguments(const char *prefix, int *argc, char ***argv); -#define conf_reg_field_array(globvar, field, type_name, path, desc, flags) \ - conf_reg_field_((void *)&globvar.field, (sizeof(globvar.field) / sizeof(globvar.field[0])), type_name, path, desc, flags) +#define pcb_conf_reg_field_array(globvar, field, type_name, path, desc, flags) \ + pcb_conf_reg_field_((void *)&globvar.field, (sizeof(globvar.field) / sizeof(globvar.field[0])), type_name, path, desc, flags) -#define conf_reg_field_scalar(globvar, field, type_name, path, desc, flags) \ - conf_reg_field_((void *)&globvar.field, 1, type_name, path, desc, flags) +#define pcb_conf_reg_field_scalar(globvar, field, type_name, path, desc, flags) \ + pcb_conf_reg_field_((void *)&globvar.field, 1, type_name, path, desc, flags) /* register a config field, array or scalar, selecting the right macro */ -#define conf_reg_field(globvar, field,isarray,type_name,cpath,cname, desc, flags) \ - conf_reg_field_ ## isarray(globvar, field,type_name,cpath "/" cname, desc, flags) +#define pcb_conf_reg_field(globvar, field,isarray,type_name,cpath,cname, desc, flags) \ + pcb_conf_reg_field_ ## isarray(globvar, field,type_name,cpath "/" cname, desc, flags) /* convert a policy text to policy value - return POL_invalid on error */ -conf_policy_t conf_policy_parse(const char *s); +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 *conf_policy_name(conf_policy_t p); +const char *pcb_conf_policy_name(conf_policy_t p); /* convert a role text to role value - return CFR_invalid on error */ -conf_role_t conf_role_parse(const char *s); +conf_role_t pcb_conf_role_parse(const char *s); /* Return the name of the role - always a static string, even for invalid roles */ -const char *conf_role_name(conf_role_t r); +const char *pcb_conf_role_name(conf_role_t r); /* Lock/unlock the structure of a role. In a locked role value of existing fields may be modified but the structure of the tree is static (can't @@ -240,29 +240,29 @@ only a subset of settings: it can build the CFR_DESIGN tree, lock it so settings that it wouldn't know how to save won't appear. NOTE: io_pcb supports all settings via attributes so does not lock. */ -void conf_lock(conf_role_t target); -void conf_unlock(conf_role_t target); +void pcb_conf_lock(conf_role_t target); +void pcb_conf_unlock(conf_role_t target); /* replace dst_role:dst_path with a copy of src_role:src_path */ -int conf_replace_subtree(conf_role_t dst_role, const char *dst_path, conf_role_t src_role, const char *src_path); +int pcb_conf_replace_subtree(conf_role_t dst_role, const char *dst_path, conf_role_t src_role, const char *src_path); /* Throw out a subtree (remove all nodes from the lihata representation). Useful for io_ plugins, on CFR_DESIGN, before loading a new file. */ -void conf_reset(conf_role_t target, const char *source_fn); +void pcb_conf_reset(conf_role_t target, const char *source_fn); /* Save an in-memory lihata representation to the disk */ -int conf_save_file(pcb_hidlib_t *hidlib, const char *project_fn, const char *pcb_fn, conf_role_t role, const char *fn); +int pcb_conf_save_file(pcb_hidlib_t *hidlib, const char *project_fn, const char *pcb_fn, conf_role_t role, const char *fn); /* Returns whether a given lihata tree is locked */ -int conf_islocked(conf_role_t target); +int pcb_conf_islocked(conf_role_t target); /* Returns whether a given lihata tree has changed since load or last save */ -int conf_isdirty(conf_role_t target); -void conf_makedirty(conf_role_t target); +int pcb_conf_isdirty(conf_role_t target); +void pcb_conf_makedirty(conf_role_t target); /* all configuration fields ever seen */ -extern htsp_t *conf_fields; +extern htsp_t *pcb_conf_fields; /***** print fields from binary to lihata/text *****/ @@ -272,12 +272,12 @@ 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 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, 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 usually the number of bytes printed. */ -int conf_print_native(conf_pfn pfn, void *ctx, const char * prefix, int verbose, conf_native_t *node); +int pcb_conf_print_native(conf_pfn pfn, void *ctx, const char * prefix, int verbose, conf_native_t *node); /* Mark a path read-only */ void pcb_conf_ro(const char *path); @@ -285,7 +285,7 @@ /****** utility ******/ -void conf_setf(conf_role_t role, const char *path, int idx, const char *fmt, ...); +void pcb_conf_setf(conf_role_t role, const char *path, int idx, const char *fmt, ...); #define conf_list_foreach_path_first(hidlib, res, conf_list, call) \ do { \ @@ -311,17 +311,17 @@ /* htsp_entry_t *e; */ #define conf_fields_foreach(e) \ - for (e = htsp_first(conf_fields); e; e = htsp_next(conf_fields, e)) + for (e = htsp_first(pcb_conf_fields); e; e = htsp_next(pcb_conf_fields, e)) /* helpers to make the code shorter */ #define conf_set_design(path, fmt, new_val) \ - conf_setf(CFR_DESIGN, path, -1, fmt, new_val) + pcb_conf_setf(CFR_DESIGN, path, -1, fmt, new_val) #define conf_set_editor(field, val) \ - conf_set(CFR_DESIGN, "editor/" #field, -1, val ? "1" : "0", POL_OVERWRITE) + pcb_conf_set(CFR_DESIGN, "editor/" #field, -1, val ? "1" : "0", POL_OVERWRITE) #define conf_set_editor_(sfield, val) \ - conf_set(CFR_DESIGN, sfield, -1, val ? "1" : "0", POL_OVERWRITE) + pcb_conf_set(CFR_DESIGN, sfield, -1, val ? "1" : "0", POL_OVERWRITE) #define conf_toggle_editor(field) \ conf_set_editor(field, !conf_core.editor.field) @@ -342,11 +342,11 @@ /* get the first config subtree node (it's a hash and its children are "design", "rc", ...); if create is 1, and the subtree doesn't exist, create an "overwrite". */ -lht_node_t *conf_lht_get_first(conf_role_t target, int create); +lht_node_t *pcb_conf_lht_get_first(conf_role_t target, int create); /* loop helper */ -conf_listitem_t *conf_list_first_str(conflist_t *list, const char **item_str, int *idx); -conf_listitem_t *conf_list_next_str(conf_listitem_t *item_li, const char **item_str, int *idx); +conf_listitem_t *pcb_conf_list_first_str(conflist_t *list, const char **item_str, int *idx); +conf_listitem_t *pcb_conf_list_next_str(conf_listitem_t *item_li, const char **item_str, int *idx); /*conf_listitem_t *item;*/ #define conf_loop_list(list, item, idx) \ @@ -354,50 +354,50 @@ /*conf_listitem_t *item; const char *item_str; */ #define conf_loop_list_str(list, item_li, item_str, idx) \ - for (idx = 0, item_li = conf_list_first_str((conflist_t *)list, &item_str, &idx); \ + for (idx = 0, item_li = pcb_conf_list_first_str((conflist_t *)list, &item_str, &idx); \ item_li != NULL;\ - item_li = conf_list_next_str(item_li, &item_str, &idx)) + item_li = pcb_conf_list_next_str(item_li, &item_str, &idx)) -const char *conf_concat_strlist(const conflist_t *lst, gds_t *buff, int *inited, char sep); +const char *pcb_conf_concat_strlist(const conflist_t *lst, gds_t *buff, int *inited, char sep); /* Print usage help for all nodes that have the CFF_USAGE flag and whose path starts with prefix (if prefix != NULL) */ -void conf_usage(const char *prefix, void (*print)(const char *name, const char *help)); +void pcb_conf_usage(const char *prefix, void (*print)(const char *name, const char *help)); /* Determine under which role a node is */ -conf_role_t conf_lookup_role(const lht_node_t *nd); +conf_role_t pcb_conf_lookup_role(const lht_node_t *nd); /* Return the lihata node of a path in target, optionally creating it with the right type */ -lht_node_t *conf_lht_get_at(conf_role_t target, const char *path, int create); +lht_node_t *pcb_conf_lht_get_at(conf_role_t target, const char *path, int create); /* Write an existing conf subtree to a file */ -int conf_export_to_file(pcb_hidlib_t *hidlib, const char *fn, conf_role_t role, const char *conf_path); +int pcb_conf_export_to_file(pcb_hidlib_t *hidlib, const char *fn, conf_role_t role, const char *conf_path); /* 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 conf_get_policy_prio(lht_node_t *node, conf_policy_t *gpolicy, long *gprio); +int pcb_conf_get_policy_prio(lht_node_t *node, 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 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(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 *conf_get_user_conf_name(); +const char *pcb_conf_get_user_conf_name(); /* Determine the file name of the project file - project_fn and pcb_fn can be NULL */ -const char *conf_get_project_conf_name(const char *project_fn, const char *pcb_fn, const char **out_project_fn); +const char *pcb_conf_get_project_conf_name(const char *project_fn, const char *pcb_fn, const char **out_project_fn); /* Get the first subtree that matches pol within target; allocate new subtree if needed */ -lht_node_t *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, 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) version; it's not strdup'd, the caller needs to keep the string available - until conf_unreg_file(). path is strdup'd */ -void conf_reg_file(const char *path, const char *intern); -void conf_unreg_file(const char *path, const char *intern); + until pcb_conf_unreg_file(). path is strdup'd */ +void pcb_conf_reg_file(const char *path, const char *intern); +void pcb_conf_unreg_file(const char *path, const char *intern); void pcb_conf_files_uninit(void); Index: trunk/src/conf_act.c =================================================================== --- trunk/src/conf_act.c (revision 26976) +++ trunk/src/conf_act.c (revision 26977) @@ -78,7 +78,7 @@ return FGW_ERR_ARGC; } if (argc > 4) { - role = conf_role_parse(a3); + role = pcb_conf_role_parse(a3); if (role == CFR_invalid) { pcb_message(PCB_MSG_ERROR, "Invalid role: '%s'", a3); return FGW_ERR_ARG_CONV; @@ -85,7 +85,7 @@ } } if (argc > 5) { - pol = conf_policy_parse(a4); + pol = pcb_conf_policy_parse(a4); if (pol == POL_invalid) { pcb_message(PCB_MSG_ERROR, "Invalid policy: '%s'", a4); return FGW_ERR_ARG_CONV; @@ -97,7 +97,7 @@ if (op == F_Delta) { double d; char *end; - conf_native_t *n = conf_get_field(a1); + conf_native_t *n = pcb_conf_get_field(a1); if (n == 0) { pcb_message(PCB_MSG_ERROR, "Can't delta-set '%s': no such path\n", argv[1]); @@ -124,16 +124,16 @@ } if (role == CFR_invalid) { - conf_native_t *n = conf_get_field(a1); + conf_native_t *n = pcb_conf_get_field(a1); if (n == NULL) { pcb_message(PCB_MSG_ERROR, "Invalid conf field '%s': no such path\n", a1); return FGW_ERR_ARG_CONV; } - rs = conf_set_native(n, 0, val); - conf_update(a1, 0); + rs = pcb_conf_set_native(n, 0, val); + pcb_conf_update(a1, 0); } else - rs = conf_set(role, path, -1, val, pol); + rs = pcb_conf_set(role, path, -1, val, pol); if (rs != 0) { pcb_message(PCB_MSG_ERROR, "conf(set) failed.\n"); @@ -154,7 +154,7 @@ path = a1; val = a2; - n = conf_get_field(a1); + n = pcb_conf_get_field(a1); if (n == NULL) { if (pcbhl_conf.rc.verbose) pcb_message(PCB_MSG_ERROR, "Invalid conf field '%s' in iseq: no such path\n", path); @@ -162,7 +162,7 @@ } gds_init(&nval); - conf_print_native_field(conf_iseq_pf, &nval, 0, &n->val, n->type, NULL, 0); + pcb_conf_print_native_field(conf_iseq_pf, &nval, 0, &n->val, n->type, NULL, 0); rs = !strcmp(nval.array, val); /* printf("iseq: %s %s==%s %d\n", path, nval.array, val, rs);*/ gds_uninit(&nval); @@ -172,7 +172,7 @@ } else if (op == F_Toggle) { - conf_native_t *n = conf_get_field(a1); + conf_native_t *n = pcb_conf_get_field(a1); const char *new_value; conf_role_t role = CFR_invalid; int res; @@ -190,7 +190,7 @@ return FGW_ERR_UNKNOWN; } if (argc > 3) { - role = conf_role_parse(a2); + role = pcb_conf_role_parse(a2); if (role == CFR_invalid) { pcb_message(PCB_MSG_ERROR, "Invalid role: '%s'", a2); return FGW_ERR_ARG_CONV; @@ -201,26 +201,26 @@ else new_value = "true"; if (role == CFR_invalid) - res = conf_set_native(n, 0, new_value); + res = pcb_conf_set_native(n, 0, new_value); else - res = conf_set(role, a1, -1, new_value, POL_OVERWRITE); + res = pcb_conf_set(role, a1, -1, new_value, POL_OVERWRITE); if (res != 0) { pcb_message(PCB_MSG_ERROR, "Can not toggle '%s': failed to set new value\n", a1); return FGW_ERR_UNKNOWN; } - conf_update(a1, -1); + pcb_conf_update(a1, -1); } else if (op == F_Reset) { conf_role_t role; - role = conf_role_parse(a1); + role = pcb_conf_role_parse(a1); if (role == CFR_invalid) { pcb_message(PCB_MSG_ERROR, "Invalid role: '%s'", a1); return FGW_ERR_ARG_CONV; } - conf_reset(role, ""); - conf_update(a1, -1); + pcb_conf_reset(role, ""); + pcb_conf_update(a1, -1); } else { Index: trunk/src/conf_core.c =================================================================== --- trunk/src/conf_core.c (revision 26976) +++ trunk/src/conf_core.c (revision 26977) @@ -35,7 +35,7 @@ void conf_core_init() { #define conf_reg(field,isarray,type_name,cpath,cname,desc,flags) \ - conf_reg_field(conf_core, field,isarray,type_name,cpath,cname,desc,flags); + pcb_conf_reg_field(conf_core, field,isarray,type_name,cpath,cname,desc,flags); #include "conf_core_fields.h" pcb_conf_core_postproc = conf_core_postproc; conf_core_postproc(); Index: trunk/src/conf_regfile.c =================================================================== --- trunk/src/conf_regfile.c (revision 26976) +++ trunk/src/conf_regfile.c (revision 26977) @@ -46,7 +46,7 @@ conf_files_inited = 0; } -void conf_reg_file(const char *path, const char *intern) +void pcb_conf_reg_file(const char *path, const char *intern) { htsi_entry_t *e; if (!conf_files_inited) conf_files_init(); @@ -61,9 +61,9 @@ else e->value++; - if (conf_in_production) { + if (pcb_conf_in_production) { if (conf_load_plug_interns(CFR_INTERNAL)) - conf_merge_all(NULL); + pcb_conf_merge_all(NULL); } } @@ -83,7 +83,7 @@ } } -void conf_unreg_file(const char *path, const char *intern) +void pcb_conf_unreg_file(const char *path, const char *intern) { assert(conf_files_inited); if (!conf_files_inited) return; Index: trunk/src/file_act.c =================================================================== --- trunk/src/file_act.c (revision 26976) +++ trunk/src/file_act.c (revision 26977) @@ -153,7 +153,7 @@ PCB = pcb_board_new(1); pcb_board_new_postproc(PCB, 1); pcb_set_design_dir(NULL); - 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", 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/font.c =================================================================== --- trunk/src/font.c (revision 26976) +++ trunk/src/font.c (revision 26977) @@ -106,7 +106,7 @@ if (res != 0) { const char *s; gds_t buff; - s = conf_concat_strlist(&conf_core.rc.default_font_file, &buff, NULL, ':'); + s = pcb_conf_concat_strlist(&conf_core.rc.default_font_file, &buff, NULL, ':'); pcb_message(PCB_MSG_WARNING, "Can't find font-symbol-file. Searched: '%s'; falling back to the embedded default font\n", s); pcb_font_load_internal(&pcb->fontkit.dflt); pcb_file_loaded_set_at("font", "default", "", "original default font"); Index: trunk/src/grid.c =================================================================== --- trunk/src/grid.c (revision 26976) +++ trunk/src/grid.c (revision 26977) @@ -192,7 +192,7 @@ if (dst < 0) return pcb_false; - conf_setf(CFR_DESIGN, "editor/grids_idx", -1, "%d", dst); + pcb_conf_setf(CFR_DESIGN, "editor/grids_idx", -1, "%d", dst); li = conflist_nth((conflist_t *)&pcbhl_conf.editor.grids, dst); /* clamp */ @@ -218,6 +218,6 @@ void pcb_grid_inval(void) { if (pcbhl_conf.editor.grids_idx > 0) - conf_setf(CFR_DESIGN, "editor/grids_idx", -1, "%d", -1 - pcbhl_conf.editor.grids_idx); + pcb_conf_setf(CFR_DESIGN, "editor/grids_idx", -1, "%d", -1 - pcbhl_conf.editor.grids_idx); } Index: trunk/src/gui_act.c =================================================================== --- trunk/src/gui_act.c (revision 26976) +++ trunk/src/gui_act.c (revision 26977) @@ -111,9 +111,9 @@ if (id == F_SubcID) { /* change the displayed name of subcircuits */ if (argc > 1) - conf_set(CFR_DESIGN, "editor/subc_id", -1, str_dir, POL_OVERWRITE); + pcb_conf_set(CFR_DESIGN, "editor/subc_id", -1, str_dir, POL_OVERWRITE); else - conf_set(CFR_DESIGN, "editor/subc_id", -1, "", POL_OVERWRITE); + pcb_conf_set(CFR_DESIGN, "editor/subc_id", -1, "", POL_OVERWRITE); pcb_gui->invalidate_all(pcb_gui); /* doesn't change too often, isn't worth anything more complicated */ pcb_draw(); @@ -122,9 +122,9 @@ if (id == F_TermID) { /* change the displayed name of terminals */ if (argc > 1) - conf_set(CFR_DESIGN, "editor/term_id", -1, str_dir, POL_OVERWRITE); + pcb_conf_set(CFR_DESIGN, "editor/term_id", -1, str_dir, POL_OVERWRITE); else - conf_set(CFR_DESIGN, "editor/term_id", -1, "", POL_OVERWRITE); + pcb_conf_set(CFR_DESIGN, "editor/term_id", -1, "", POL_OVERWRITE); pcb_gui->invalidate_all(pcb_gui); /* doesn't change too often, isn't worth anything more complicated */ pcb_draw(); @@ -150,10 +150,10 @@ pcb_notify_crosshair_change(pcb_false); if (conf_core.editor.all_direction_lines) { conf_toggle_editor(all_direction_lines); - conf_setf(CFR_DESIGN,"editor/line_refraction",-1,"%d",0); + pcb_conf_setf(CFR_DESIGN,"editor/line_refraction",-1,"%d",0); } else { - conf_setf(CFR_DESIGN,"editor/line_refraction",-1,"%d",(conf_core.editor.line_refraction +1) % 3); + pcb_conf_setf(CFR_DESIGN,"editor/line_refraction",-1,"%d",(conf_core.editor.line_refraction +1) % 3); } pcb_tool_adjust_attached_objects(); pcb_notify_crosshair_change(pcb_true); @@ -161,9 +161,9 @@ case F_CycleCrosshair: pcb_notify_crosshair_change(pcb_false); - conf_setf(CFR_CLI, "editor/crosshair_shape_idx", 0, "%d", CrosshairShapeIncrement(pcbhl_conf.editor.crosshair_shape_idx)); + 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) - conf_set(CFR_CLI, "editor/crosshair_shape_idx", 0, "0", POL_OVERWRITE); + pcb_conf_set(CFR_CLI, "editor/crosshair_shape_idx", 0, "0", POL_OVERWRITE); pcb_notify_crosshair_change(pcb_true); break; @@ -913,13 +913,13 @@ switch(id) { case -2: case F_Toggle: - 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, POL_OVERWRITE); break; case F_On: - conf_set(CFR_DESIGN, "editor/fullscreen", -1, "1", POL_OVERWRITE); + pcb_conf_set(CFR_DESIGN, "editor/fullscreen", -1, "1", POL_OVERWRITE); break; case F_Off: - conf_set(CFR_DESIGN, "editor/fullscreen", -1, "0", POL_OVERWRITE); + pcb_conf_set(CFR_DESIGN, "editor/fullscreen", -1, "0", POL_OVERWRITE); break; default: PCB_ACT_FAIL(FullScreen); @@ -1741,7 +1741,7 @@ tmp[0] = '0' + !conf_core.temp.clip_inhibit_chg; tmp[1] = '\0'; - conf_set(CFR_CLI, "temp/clip_inhibit_chg", 0, tmp, POL_OVERWRITE); + pcb_conf_set(CFR_CLI, "temp/clip_inhibit_chg", 0, tmp, POL_OVERWRITE); PCB_ACT_IRES(0); Index: trunk/src/hid_init.c =================================================================== --- trunk/src/hid_init.c (revision 26976) +++ trunk/src/hid_init.c (revision 26977) @@ -293,7 +293,7 @@ { pcb_events_init(); pcb_file_loaded_init(); - conf_init(); + pcb_conf_init(); conf_core_init(); pcbhl_conf_postproc(); pcb_hidlib_conf_init(); @@ -307,7 +307,7 @@ { pcb_actions_init(); - conf_load_all(NULL, NULL); + pcb_conf_load_all(NULL, NULL); pup_init(&pcb_pup); pcb_pup.error_stack_enable = 1; @@ -316,7 +316,7 @@ pup_buildin_load(&pcb_pup, local_buildins); pup_autoload_dir(&pcb_pup, NULL, NULL); - conf_load_extra(NULL, NULL); + pcb_conf_load_extra(NULL, NULL); pcb_units_init(); } @@ -326,12 +326,12 @@ pcb_hidlib_event_uninit(); pcb_hid_dlg_uninit(); - if (conf_isdirty(CFR_USER)) - conf_save_file(NULL, NULL, NULL, CFR_USER, NULL); + if (pcb_conf_isdirty(CFR_USER)) + pcb_conf_save_file(NULL, NULL, NULL, CFR_USER, NULL); pcb_hid_uninit(); pcb_events_uninit(); - conf_uninit(); + pcb_conf_uninit(); pcb_plugin_uninit(); pcb_actions_uninit(); pcb_dad_unit_uninit(); @@ -379,7 +379,7 @@ int n; const char *g; - apg = conf_list_next_str(apg, &g, &n); + apg = pcb_conf_list_next_str(apg, &g, &n); if (apg == NULL) goto ran_out_of_hids; pcb_gui = pcb_hid_find_gui(g); @@ -476,7 +476,7 @@ *a = arg; } else { - if (conf_set_from_cli(NULL, arg, NULL, &why) != 0) { + if (pcb_conf_set_from_cli(NULL, arg, NULL, &why) != 0) { fprintf(stderr, "Error: failed to set config %s: %s\n", arg, why); exit(1); } @@ -495,7 +495,7 @@ /* Now that plugins are already initialized, apply plugin config items */ for(n = 0; n < vtp0_len(&ga->plugin_cli_conf); n++) { const char *why, *arg = ga->plugin_cli_conf.array[n]; - if (conf_set_from_cli(NULL, arg, NULL, &why) != 0) { + if (pcb_conf_set_from_cli(NULL, arg, NULL, &why) != 0) { fprintf(stderr, "Error: failed to set config %s: %s\n", arg, why); return 1; } @@ -545,7 +545,7 @@ /* plugins may have installed their new fields, reinterpret the config (memory lht -> memory bin) to get the new fields */ - conf_update(NULL, -1); + pcb_conf_update(NULL, -1); if (ga->main_action != NULL) { int res = pcb_parse_command(ga->main_action, pcb_true); Index: trunk/src/hidlib_conf.c =================================================================== --- trunk/src/hidlib_conf.c (revision 26976) +++ trunk/src/hidlib_conf.c (revision 26977) @@ -43,7 +43,7 @@ int cnt = 0; #define conf_reg(field,isarray,type_name,cpath,cname,desc,flags) \ - conf_reg_field(pcbhl_conf, field,isarray,type_name,cpath,cname,desc,flags); + pcb_conf_reg_field(pcbhl_conf, field,isarray,type_name,cpath,cname,desc,flags); #include "hidlib_conf_fields.h" return cnt; @@ -67,5 +67,5 @@ void pcb_hidlib_set_unit(pcb_hidlib_t *hidlib, const pcb_unit_t *new_unit) { if (new_unit != NULL && new_unit->allow != PCB_UNIT_NO_PRINT) - 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, POL_OVERWRITE); } Index: trunk/src/layer_vis.c =================================================================== --- trunk/src/layer_vis.c (revision 26976) +++ trunk/src/layer_vis.c (revision 26977) @@ -346,7 +346,7 @@ void pcb_layer_vis_init(void) { - conf_native_t *n_mask = conf_get_field("editor/show_mask"); + conf_native_t *n_mask = pcb_conf_get_field("editor/show_mask"); static conf_hid_callbacks_t cbs_mask; layer_vis_conf_id = conf_hid_reg(layer_vis_cookie, NULL); Index: trunk/src/main.c =================================================================== --- trunk/src/main.c (revision 26976) +++ trunk/src/main.c (revision 26977) @@ -229,7 +229,7 @@ exit(1); } sprintf(exec_prefix, "%s%s%s", bindir, PCB_DIR_SEPARATOR_S, BINDIR_TO_EXECPREFIX); - 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, POL_OVERWRITE); /* export the most important paths and data for child processes (e.g. parametric footprints) */ se |= pcb_setenv("PCB_RND_VERSION", PCB_VERSION, 1); Index: trunk/src/obj_line_drcenf.c =================================================================== --- trunk/src/obj_line_drcenf.c (revision 26976) +++ trunk/src/obj_line_drcenf.c (revision 26977) @@ -499,11 +499,11 @@ if (conf_core.editor.line_refraction != 0) { if (shift) { if (conf_core.editor.line_refraction !=2) - conf_setf(CFR_DESIGN, "editor/line_refraction", -1, "%d", 2); + pcb_conf_setf(CFR_DESIGN, "editor/line_refraction", -1, "%d", 2); } else{ if (conf_core.editor.line_refraction != 1) - conf_setf(CFR_DESIGN, "editor/line_refraction", -1, "%d", 1); + pcb_conf_setf(CFR_DESIGN, "editor/line_refraction", -1, "%d", 1); } } pcb_crosshair.X = rs.X; @@ -513,11 +513,11 @@ if (conf_core.editor.line_refraction !=0) { if (shift) { if (conf_core.editor.line_refraction != 1) - conf_setf(CFR_DESIGN, "editor/line_refraction", -1, "%d", 1); + pcb_conf_setf(CFR_DESIGN, "editor/line_refraction", -1, "%d", 1); } else { if (conf_core.editor.line_refraction != 2) - conf_setf(CFR_DESIGN, "editor/line_refraction", -1, "%d", 2); + pcb_conf_setf(CFR_DESIGN, "editor/line_refraction", -1, "%d", 2); } } pcb_crosshair.X = r45.X; Index: trunk/src/paths.c =================================================================== --- trunk/src/paths.c (revision 26976) +++ trunk/src/paths.c (revision 26977) @@ -217,7 +217,7 @@ for(q = path; *q != '\0'; q++) if (*q == '.') *q = '/'; - cn = conf_get_field(path); + cn = pcb_conf_get_field(path); if (cn == NULL) { if (!(flags & PCB_SUBST_QUIET)) pcb_message(PCB_MSG_ERROR, "pcb_strdup_subst(): can't resolve $(%s) conf var: not found in the conf tree\n", path); Index: trunk/src/plug_footprint.c =================================================================== --- trunk/src/plug_footprint.c (revision 26976) +++ trunk/src/plug_footprint.c (revision 26977) @@ -423,7 +423,7 @@ const char *pcb_fp_default_search_path(void) { - return conf_concat_strlist(&conf_core.rc.library_search_paths, &fpds_paths, &fpds_inited, ':'); + return pcb_conf_concat_strlist(&conf_core.rc.library_search_paths, &fpds_paths, &fpds_inited, ':'); } int pcb_fp_host_uninit(void) Index: trunk/src/plug_io.c =================================================================== --- trunk/src/plug_io.c (revision 26976) +++ trunk/src/plug_io.c (revision 26977) @@ -227,7 +227,7 @@ } if ((res == 0) && (load_settings)) - conf_load_project(NULL, Filename); + pcb_conf_load_project(NULL, Filename); if (res == 0) pcb_set_design_dir(Filename); @@ -235,7 +235,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); - 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", POL_OVERWRITE); /* we have only one font now, make sure it is selected */ plug_io_err(&Ptr->hidlib, res, "load pcb", Filename); return res; @@ -531,11 +531,11 @@ /* geda/pcb compatibility: use attribute PCB::grid::unit as unit, if present */ unit_suffix = pcb_attrib_get(PCB, "PCB::grid::unit"); if (unit_suffix && *unit_suffix) { - lht_node_t *nat = conf_lht_get_at(CFR_DESIGN, "editor/grid_unit", 0); + lht_node_t *nat = pcb_conf_lht_get_at(CFR_DESIGN, "editor/grid_unit", 0); if (nat == NULL) { const pcb_unit_t *new_unit = get_unit_struct(unit_suffix); if (new_unit) - conf_set(settings_dest, "editor/grid_unit", -1, unit_suffix, POL_OVERWRITE); + pcb_conf_set(settings_dest, "editor/grid_unit", -1, unit_suffix, POL_OVERWRITE); } } Index: trunk/src/tool.c =================================================================== --- trunk/src/tool.c (revision 26976) +++ trunk/src/tool.c (revision 26977) @@ -139,7 +139,7 @@ pcb_tool_next_id = id; uninit_current_tool(); sprintf(id_s, "%d", id); - conf_set(CFR_DESIGN, "editor/mode", -1, id_s, POL_OVERWRITE); + pcb_conf_set(CFR_DESIGN, "editor/mode", -1, id_s, POL_OVERWRITE); init_current_tool(); recursing = pcb_false; Index: trunk/src/tool_line.c =================================================================== --- trunk/src/tool_line.c (revision 26976) +++ trunk/src/tool_line.c (revision 26977) @@ -209,7 +209,7 @@ pcb_crosshair.AttachedLine.Point2.Y = pcb_crosshair.Route.end_point.Y; if (conf_core.editor.swap_start_direction) - conf_setf(CFR_DESIGN,"editor/line_refraction", -1, "%d",conf_core.editor.line_refraction ^ 3); + pcb_conf_setf(CFR_DESIGN,"editor/line_refraction", -1, "%d",conf_core.editor.line_refraction ^ 3); if (conf_core.editor.orthogonal_moves) { /* set the mark to the new starting point so ortho works as expected and we can draw a perpendicular line from here */ @@ -319,7 +319,7 @@ if (conf_core.editor.swap_start_direction) { - conf_setf(CFR_DESIGN,"editor/line_refraction", -1, "%d",conf_core.editor.line_refraction ^ 3); + pcb_conf_setf(CFR_DESIGN,"editor/line_refraction", -1, "%d",conf_core.editor.line_refraction ^ 3); } pcb_subc_as_board_update(PCB); } Index: trunk/src_plugins/asm/asm.c =================================================================== --- trunk/src_plugins/asm/asm.c (revision 26976) +++ trunk/src_plugins/asm/asm.c (revision 26977) @@ -581,8 +581,8 @@ void pplg_uninit_asm(void) { pcb_remove_actions_by_cookie(asm_cookie); - conf_unreg_file(ASM_CONF_FN, asm_conf_internal); - conf_unreg_fields("plugins/asm1/"); + pcb_conf_unreg_file(ASM_CONF_FN, asm_conf_internal); + pcb_conf_unreg_fields("plugins/asm1/"); } @@ -590,9 +590,9 @@ int pplg_init_asm(void) { PCB_API_CHK_VER; - conf_reg_file(ASM_CONF_FN, asm_conf_internal); + pcb_conf_reg_file(ASM_CONF_FN, asm_conf_internal); #define conf_reg(field,isarray,type_name,cpath,cname,desc,flags) \ - conf_reg_field(conf_asm, field,isarray,type_name,cpath,cname,desc,flags); + pcb_conf_reg_field(conf_asm, field,isarray,type_name,cpath,cname,desc,flags); #include "asm_conf_fields.h" PCB_REGISTER_ACTIONS(asm_action_list, asm_cookie) Index: trunk/src_plugins/cam/cam.c =================================================================== --- trunk/src_plugins/cam/cam.c (revision 26976) +++ trunk/src_plugins/cam/cam.c (revision 26977) @@ -285,8 +285,8 @@ void pplg_uninit_cam(void) { - conf_unreg_file(CAM_CONF_FN, cam_conf_internal); - conf_unreg_fields("plugins/cam/"); + pcb_conf_unreg_file(CAM_CONF_FN, cam_conf_internal); + pcb_conf_unreg_fields("plugins/cam/"); pcb_remove_actions_by_cookie(cam_cookie); pcb_export_remove_opts_by_cookie(cam_cookie); } @@ -297,9 +297,9 @@ int pplg_init_cam(void) { PCB_API_CHK_VER; - conf_reg_file(CAM_CONF_FN, cam_conf_internal); + pcb_conf_reg_file(CAM_CONF_FN, cam_conf_internal); #define conf_reg(field,isarray,type_name,cpath,cname,desc,flags) \ - conf_reg_field(conf_cam, field,isarray,type_name,cpath,cname,desc,flags); + pcb_conf_reg_field(conf_cam, field,isarray,type_name,cpath,cname,desc,flags); #include "cam_conf_fields.h" PCB_REGISTER_ACTIONS(cam_action_list, cam_cookie) Index: trunk/src_plugins/cam/cam_gui.c =================================================================== --- trunk/src_plugins/cam/cam_gui.c (revision 26976) +++ trunk/src_plugins/cam/cam_gui.c (revision 26977) @@ -59,7 +59,7 @@ pcb_dad_tree_clear(tree); /* add all new items */ - cn = conf_get_field("plugins/cam/jobs"); + cn = pcb_conf_get_field("plugins/cam/jobs"); if (cn != NULL) { conf_listitem_t *item; int idx; Index: trunk/src_plugins/ddraft/constraint_gui.c =================================================================== --- trunk/src_plugins/ddraft/constraint_gui.c (revision 26976) +++ trunk/src_plugins/ddraft/constraint_gui.c (revision 26977) @@ -190,7 +190,7 @@ cnstgui_ctx.inhibit_confchg++; nv = (cnstgui_ctx.dlg[cnstgui_ctx.alldir].val.lng) ? "1" : "0"; - conf_set(CFR_DESIGN, "editor/all_direction_lines", -1, nv, POL_OVERWRITE); + pcb_conf_set(CFR_DESIGN, "editor/all_direction_lines", -1, nv, POL_OVERWRITE); cnstgui_ctx.inhibit_confchg--; } Index: trunk/src_plugins/ddraft/ddraft.c =================================================================== --- trunk/src_plugins/ddraft/ddraft.c (revision 26976) +++ trunk/src_plugins/ddraft/ddraft.c (revision 26977) @@ -495,9 +495,9 @@ confid = conf_hid_reg(ddraft_cookie, NULL); - cn = conf_get_field("editor/all_direction_lines"); + cn = pcb_conf_get_field("editor/all_direction_lines"); conf_hid_set_cb(cn, confid, &conf_cbs_adl); - cn = conf_get_field("editor/mode"); + cn = pcb_conf_get_field("editor/mode"); conf_hid_set_cb(cn, confid, &conf_cbs_mode); return 0; } Index: trunk/src_plugins/diag/diag.c =================================================================== --- trunk/src_plugins/diag/diag.c (revision 26976) +++ trunk/src_plugins/diag/diag.c (revision 26977) @@ -55,8 +55,8 @@ ; static const char pcb_acth_DumpConf[] = "Perform various operations on the configuration tree."; -extern lht_doc_t *conf_main_root[]; -extern lht_doc_t *conf_plug_root[]; +extern lht_doc_t *pcb_conf_main_root[]; +extern lht_doc_t *pcb_conf_plug_root[]; static fgw_error_t pcb_act_DumpConf(fgw_arg_t *res, int argc, fgw_arg_t *argv) { int op; @@ -79,19 +79,19 @@ const char *srole, *prefix = ""; PCB_ACT_CONVARG(2, FGW_STR, DumpConf, srole = argv[2].val.str); PCB_ACT_MAY_CONVARG(3, FGW_STR, DumpConf, prefix = argv[3].val.str); - role = conf_role_parse(srole); + role = pcb_conf_role_parse(srole); if (role == CFR_invalid) { pcb_message(PCB_MSG_ERROR, "Invalid role: '%s'\n", argv[1]); PCB_ACT_IRES(1); return 0; } - if (conf_main_root[role] != NULL) { + if (pcb_conf_main_root[role] != NULL) { printf("%s### main\n", prefix); - if (conf_main_root[role] != NULL) - lht_dom_export(conf_main_root[role]->root, stdout, prefix); + if (pcb_conf_main_root[role] != NULL) + lht_dom_export(pcb_conf_main_root[role]->root, stdout, prefix); printf("%s### plugin\n", prefix); - if (conf_plug_root[role] != NULL) - lht_dom_export(conf_plug_root[role]->root, stdout, prefix); + if (pcb_conf_plug_root[role] != NULL) + lht_dom_export(pcb_conf_plug_root[role]->root, stdout, prefix); } else printf("%s \n", prefix); @@ -119,7 +119,7 @@ PCB_ACT_CONVARG(1, FGW_STR, EvalConf, path = argv[1].val.str); - nat = conf_get_field(path); + nat = pcb_conf_get_field(path); if (nat == NULL) { pcb_message(PCB_MSG_ERROR, "EvalConf: invalid path %s - no such config setting\n", path); PCB_ACT_IRES(-1); @@ -129,15 +129,15 @@ printf("Conf node %s\n", path); for(role = 0; role < CFR_max_real; role++) { lht_node_t *n; - printf(" Role: %s\n", conf_role_name(role)); - n = conf_lht_get_at(role, path, 0); + 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; - long prio = conf_default_prio[role]; + long prio = pcb_conf_default_prio[role]; - if (conf_get_policy_prio(n, &pol, &prio) == 0) - printf(" * policy=%s\n * prio=%ld\n", conf_policy_name(pol), prio); + if (pcb_conf_get_policy_prio(n, &pol, &prio) == 0) + printf(" * policy=%s\n * prio=%ld\n", pcb_conf_policy_name(pol), prio); if (n->file_name != NULL) printf(" * from=%s:%d.%d\n", n->file_name, n->line, n->col); @@ -151,7 +151,7 @@ } printf(" Native:\n"); - conf_print_native((conf_pfn)pcb_fprintf, stdout, " ", 1, nat); + pcb_conf_print_native((conf_pfn)pcb_fprintf, stdout, " ", 1, nat); PCB_ACT_IRES(0); return 0; @@ -160,7 +160,7 @@ static const char pcb_acts_DumpLayers[] = "dumplayers([all])\n"; static const char pcb_acth_DumpLayers[] = "Print info about each layer"; -extern lht_doc_t *conf_main_root[]; +extern lht_doc_t *pcb_conf_main_root[]; static fgw_error_t pcb_act_DumpLayers(fgw_arg_t *res, int argc, fgw_arg_t *argv) { int op = -2, g, n, used; @@ -524,7 +524,7 @@ void pplg_uninit_diag(void) { pcb_remove_actions_by_cookie(diag_cookie); - conf_unreg_fields("plugins/diag/"); + pcb_conf_unreg_fields("plugins/diag/"); pcb_event_unbind_allcookie(diag_cookie); } @@ -534,7 +534,7 @@ PCB_API_CHK_VER; #define conf_reg(field,isarray,type_name,cpath,cname,desc,flags) \ - conf_reg_field(conf_diag, field,isarray,type_name,cpath,cname,desc,flags); + pcb_conf_reg_field(conf_diag, field,isarray,type_name,cpath,cname,desc,flags); #include "diag_conf_fields.h" pcb_event_bind(PCB_EVENT_USER_INPUT_POST, ev_ui_post, NULL, diag_cookie); Index: trunk/src_plugins/diag/diag_conf.c =================================================================== --- trunk/src_plugins/diag/diag_conf.c (revision 26976) +++ trunk/src_plugins/diag/diag_conf.c (revision 26977) @@ -35,12 +35,12 @@ if (match_prefix != NULL) pl = strlen(match_prefix); - for (e = htsp_first(conf_fields); e; e = htsp_next(conf_fields, e)) { + for (e = htsp_first(pcb_conf_fields); e; e = htsp_next(pcb_conf_fields, e)) { conf_native_t *node = (conf_native_t *)e->value; if (match_prefix != NULL) { if (strncmp(node->hash_path, match_prefix, pl) != 0) continue; } - conf_print_native((conf_pfn)pcb_fprintf, f, prefix, verbose, node); + pcb_conf_print_native((conf_pfn)pcb_fprintf, f, prefix, verbose, node); } } Index: trunk/src_plugins/dialogs/dialogs.c =================================================================== --- trunk/src_plugins/dialogs/dialogs.c (revision 26976) +++ trunk/src_plugins/dialogs/dialogs.c (revision 26977) @@ -108,7 +108,7 @@ pcb_remove_actions_by_cookie(dialogs_cookie); pcb_view_dlg_uninit(); pcb_dlg_fontsel_uninit(); - conf_unreg_fields("plugins/dialogs/"); + pcb_conf_unreg_fields("plugins/dialogs/"); } #include "dolists.h" Index: trunk/src_plugins/dialogs/dlg_fontsel.c =================================================================== --- trunk/src_plugins/dialogs/dlg_fontsel.c (revision 26976) +++ trunk/src_plugins/dialogs/dlg_fontsel.c (revision 26977) @@ -138,7 +138,7 @@ return; } pcb_del_font(&PCB->fontkit, conf_core.design.text_font_id); - conf_set(CFR_DESIGN, "design/text_font_id", 0, "0", POL_OVERWRITE); + pcb_conf_set(CFR_DESIGN, "design/text_font_id", 0, "0", 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 26976) +++ trunk/src_plugins/dialogs/dlg_pref.c (revision 26977) @@ -80,34 +80,34 @@ void pcb_pref_dlg2conf_item(pref_ctx_t *ctx, pref_confitem_t *item, pcb_hid_attribute_t *attr) { - pref_confitem_t *old = ctx->conf_lock; - conf_native_t *cn = conf_get_field(item->confpath); + pref_confitem_t *old = ctx->pcb_conf_lock; + conf_native_t *cn = pcb_conf_get_field(item->confpath); if (cn == NULL) return; - ctx->conf_lock = item; + ctx->pcb_conf_lock = item; switch(cn->type) { case CFN_COORD: if (cn->val.coord[0] != attr->val.crd) - conf_setf(ctx->role, item->confpath, -1, "%.8$mm", attr->val.crd); + pcb_conf_setf(ctx->role, item->confpath, -1, "%.8$mm", attr->val.crd); break; case CFN_BOOLEAN: case CFN_INTEGER: if (cn->val.integer[0] != attr->val.lng) - conf_setf(ctx->role, item->confpath, -1, "%d", attr->val.lng); + pcb_conf_setf(ctx->role, item->confpath, -1, "%d", attr->val.lng); break; case CFN_REAL: if (cn->val.real[0] != attr->val.dbl) - conf_setf(ctx->role, item->confpath, -1, "%f", attr->val.dbl); + pcb_conf_setf(ctx->role, item->confpath, -1, "%f", attr->val.dbl); break; case CFN_STRING: if (strcmp(cn->val.string[0], attr->val.str) != 0) - conf_set(ctx->role, item->confpath, -1, attr->val.str, POL_OVERWRITE); + pcb_conf_set(ctx->role, item->confpath, -1, attr->val.str, POL_OVERWRITE); break; default: pcb_message(PCB_MSG_ERROR, "pcb_pref_dlg2conf_item(): widget type not handled\n"); } - ctx->conf_lock = old; + ctx->pcb_conf_lock = old; } pcb_bool pcb_pref_dlg2conf_table(pref_ctx_t *ctx, pref_confitem_t *list, pcb_hid_attribute_t *attr) @@ -127,7 +127,7 @@ void pcb_pref_create_conf_item(pref_ctx_t *ctx, pref_confitem_t *item, void (*change_cb)(void *hid_ctx, void *caller_data, pcb_hid_attribute_t *attr)) { - conf_native_t *cn = conf_get_field(item->confpath); + conf_native_t *cn = pcb_conf_get_field(item->confpath); if (cn == NULL) { pcb_message(PCB_MSG_ERROR, "Internal error: pcb_pref_create_conf_item(): invalid conf node %s\n", item->confpath); @@ -198,7 +198,7 @@ { pref_confitem_t *c; for(c = list; c->confpath != NULL; c++) { - conf_native_t *cn = conf_get_field(c->confpath); + conf_native_t *cn = pcb_conf_get_field(c->confpath); c->cnext = NULL; if (cn != NULL) conf_hid_set_data(cn, pref_hid, NULL); @@ -359,7 +359,7 @@ pref_confitem_t *i; for(i = conf_hid_get_data(cfg, pref_hid); i != NULL; i = i->cnext) - if (i != pref_ctx.conf_lock) + if (i != pref_ctx.pcb_conf_lock) pcb_pref_conf2dlg_item(cfg, i); pcb_pref_dlg_conf_changed_cb(&pref_ctx, cfg, arr_idx); Index: trunk/src_plugins/dialogs/dlg_pref.h =================================================================== --- trunk/src_plugins/dialogs/dlg_pref.h (revision 26976) +++ trunk/src_plugins/dialogs/dlg_pref.h (revision 26977) @@ -36,7 +36,7 @@ conf_role_t role; /* where changes are saved to */ - pref_confitem_t *conf_lock; /* the item being changed - should be ignored in a conf change callback */ + pref_confitem_t *pcb_conf_lock; /* the item being changed - should be ignored in a conf change callback */ }; extern pref_ctx_t pref_ctx; Index: trunk/src_plugins/dialogs/dlg_pref_color.c =================================================================== --- trunk/src_plugins/dialogs/dlg_pref_color.c (revision 26976) +++ trunk/src_plugins/dialogs/dlg_pref_color.c (revision 26977) @@ -36,7 +36,7 @@ int n; if (ctx->color.wlayer != NULL) { - nat = conf_get_field("appearance/color/layer"); + nat = pcb_conf_get_field("appearance/color/layer"); for (n = 0; n < nat->used; n++) PCB_DAD_SET_VALUE(ctx->dlg_hid_ctx, ctx->color.wlayer[n], clr, nat->val.color[n]); } @@ -44,7 +44,7 @@ for(n = 0; n < ctx->color.ngen; n++) { int w = ctx->color.wgen[n]; const char *path = ctx->dlg[w].user_data; - nat = conf_get_field(path); + nat = pcb_conf_get_field(path); if (nat != NULL) PCB_DAD_SET_VALUE(ctx->dlg_hid_ctx, w, clr, nat->val.color[0]); } @@ -73,7 +73,7 @@ { pref_ctx_t *ctx = caller_data; const char *path = attr->user_data; - conf_setf(ctx->role, path, -1, "%s", attr->val.clr.str); + pcb_conf_setf(ctx->role, path, -1, "%s", attr->val.clr.str); pcb_gui->invalidate_all(pcb_gui); } @@ -81,7 +81,7 @@ { pref_ctx_t *ctx = caller_data; int idx = (int *)attr->user_data - ctx->color.wlayer; - conf_setf(ctx->role, "appearance/color/layer", idx, "%s", attr->val.clr.str); + pcb_conf_setf(ctx->role, "appearance/color/layer", idx, "%s", attr->val.clr.str); } @@ -130,7 +130,7 @@ PCB_DAD_BEGIN_VBOX(ctx->dlg); /* layer */ PCB_DAD_COMPFLAG(ctx->dlg, PCB_HATF_EXPFILL | PCB_HATF_SCROLL); - nat = conf_get_field("appearance/color/layer"); + nat = pcb_conf_get_field("appearance/color/layer"); if (nat->type == CFN_COLOR) { PCB_DAD_LABEL(ctx->dlg, "NOTE: these colors are used only\nwhen creating new layers."); ctx->color.wlayer = calloc(sizeof(int), nat->used); Index: trunk/src_plugins/dialogs/dlg_pref_conf.c =================================================================== --- trunk/src_plugins/dialogs/dlg_pref_conf.c (revision 26976) +++ trunk/src_plugins/dialogs/dlg_pref_conf.c (revision 26977) @@ -58,10 +58,10 @@ char path[1024]; /* alpha sort keys for the more consistend UI */ - for(e = htsp_first(conf_fields), num_paths = 0; e; e = htsp_next(conf_fields, e)) + for(e = htsp_first(pcb_conf_fields), num_paths = 0; e; e = htsp_next(pcb_conf_fields, e)) num_paths++; sorted = malloc(sizeof(htsp_entry_t *) * num_paths); - for(e = htsp_first(conf_fields), n = 0; e; e = htsp_next(conf_fields, e), n++) + for(e = htsp_first(pcb_conf_fields), n = 0; e; e = htsp_next(pcb_conf_fields, e), n++) sorted[n] = e; qsort(sorted, num_paths, sizeof(htsp_entry_t *), conf_tree_cmp); @@ -147,17 +147,17 @@ for(n = 0; n < CFR_max_real; n++) { char *cell[5]= {NULL}; - cell[0] = pcb_strdup(conf_role_name(n)); + cell[0] = pcb_strdup(pcb_conf_role_name(n)); if (nat != NULL) { lht_node_t *nd; - long prio = conf_default_prio[n]; + long prio = pcb_conf_default_prio[n]; conf_policy_t pol = POL_OVERWRITE; - nd = conf_lht_get_at(n, nat->hash_path, 0); + nd = pcb_conf_lht_get_at(n, nat->hash_path, 0); if (nd != NULL) { /* role, prio, policy, value */ - conf_get_policy_prio(nd, &pol, &prio); + pcb_conf_get_policy_prio(nd, &pol, &prio); cell[1] = pcb_strdup_printf("%ld", prio); - cell[2] = pcb_strdup(conf_policy_name(pol)); + cell[2] = pcb_strdup(pcb_conf_policy_name(pol)); cell[3] = pcb_strdup(pref_conf_get_val(nd, nat, idx)); } } @@ -193,7 +193,7 @@ lht_node_t *src; if ((path != NULL) && (nat == NULL)) - nat = conf_get_field(path); + nat = pcb_conf_get_field(path); if ((path == NULL) && (nat != NULL)) path = nat->hash_path; @@ -238,7 +238,7 @@ pcb_dad_tree_clear(tree); for (n = conflist_first(&nat->val.list[idx]); n != NULL; n = conflist_next(n)) { - rolename = conf_role_name(conf_lookup_role(n->prop.src)); + rolename = pcb_conf_role_name(pcb_conf_lookup_role(n->prop.src)); cell[0] = rolename == NULL ? pcb_strdup("") : pcb_strdup(rolename); cell[1] = pcb_strdup_printf("%ld", n->prop.prio); cell[2] = pcb_strdup(print_conf_val(n->type, &n->val, buf, sizeof(buf))); @@ -254,7 +254,7 @@ src = nat->prop[idx].src; if (src != NULL) { - rolename = conf_role_name(conf_lookup_role(nat->prop[idx].src)); + rolename = pcb_conf_role_name(pcb_conf_lookup_role(nat->prop[idx].src)); hv.str = tmp = pcb_strdup_printf("prio: %d role: %s\nsource: %s:%d.%d", nat->prop[idx].prio, rolename, src->file_name, src->line, src->col); } else @@ -295,7 +295,7 @@ } /* non-array selection */ - nat = conf_get_field(row->path); + nat = pcb_conf_get_field(row->path); if ((nat != NULL) && (nat->array_size > 1)) { /* array head: do not display for now */ dlg_conf_select_node((pref_ctx_t *)tree->user_ctx, NULL, NULL, 0); return; Index: trunk/src_plugins/dialogs/dlg_pref_confedit.c =================================================================== --- trunk/src_plugins/dialogs/dlg_pref_confedit.c (revision 26976) +++ trunk/src_plugins/dialogs/dlg_pref_confedit.c (revision 26977) @@ -51,7 +51,7 @@ static void confedit_brd2dlg(confedit_ctx_t *ctx) { pcb_hid_attr_val_t hv; - lht_node_t *nl, *nd = conf_lht_get_at(ctx->role, ctx->nat->hash_path, 1); + lht_node_t *nl, *nd = pcb_conf_lht_get_at(ctx->role, ctx->nat->hash_path, 1); const char *val; if (ctx->idx >= ctx->nat->array_size) @@ -142,7 +142,7 @@ pcb_hid_attribute_t *attr = &ctx->dlg[ctx->wnewval]; pcb_hid_tree_t *tree = attr->wdata; pcb_hid_row_t *r; - lht_node_t *nd = conf_lht_get_at(ctx->role, ctx->nat->hash_path, 0); + lht_node_t *nd = pcb_conf_lht_get_at(ctx->role, ctx->nat->hash_path, 0); if (nd == NULL) { pcb_message(PCB_MSG_ERROR, "Internal error: can't copy back to non-existing list!\n"); @@ -163,8 +163,8 @@ lht_dom_list_append(nd, n); n->data.text.value = pcb_strdup(r->cell[0]); } - conf_makedirty(ctx->role); - conf_update(ctx->nat->hash_path, ctx->idx); + pcb_conf_makedirty(ctx->role); + pcb_conf_update(ctx->nat->hash_path, ctx->idx); } return; case CFN_max: @@ -173,10 +173,10 @@ if (val == NULL) val = ""; - 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, POL_OVERWRITE); if ((ctx->role == CFR_USER) || (ctx->role == CFR_PROJECT)) - conf_save_file(&PCB->hidlib, NULL, (PCB == NULL ? NULL : PCB->hidlib.filename), ctx->role, NULL); + pcb_conf_save_file(&PCB->hidlib, NULL, (PCB == NULL ? NULL : PCB->hidlib.filename), ctx->role, NULL); else if (ctx->role == CFR_DESIGN) pcb_board_set_changed_flag(1); @@ -383,5 +383,5 @@ return; } - conf_del(r->user_data2.lng, pctx->conf.selected_nat->hash_path, pctx->conf.selected_idx); + pcb_conf_del(r->user_data2.lng, pctx->conf.selected_nat->hash_path, pctx->conf.selected_idx); } Index: trunk/src_plugins/dialogs/dlg_pref_lib.c =================================================================== --- trunk/src_plugins/dialogs/dlg_pref_lib.c (revision 26976) +++ trunk/src_plugins/dialogs/dlg_pref_lib.c (revision 26977) @@ -74,7 +74,7 @@ { if (nd->file_name != NULL) return nd->file_name; - return conf_role_name(conf_lookup_role(nd)); + return pcb_conf_role_name(pcb_conf_lookup_role(nd)); } /* Current libraries from config to dialog box: after the change, fill @@ -140,10 +140,10 @@ ctx->lib.lock++; /* get the list and clean it */ - m = conf_lht_get_first(ctx->role, 0); + 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) - conf_set(ctx->role, "rc/library_search_paths", 0, "", POL_OVERWRITE); + pcb_conf_set(ctx->role, "rc/library_search_paths", 0, "", POL_OVERWRITE); lst = lht_tree_path_(m->doc, m, "rc/library_search_paths", 1, 0, NULL); assert(lst != NULL); lht_clean_list(lst); @@ -157,8 +157,8 @@ pcb_dad_tree_modify_cell(attr, r, 2, pcb_strdup(pref_node_src(nd))); } - conf_update("rc/library_search_paths", -1); - conf_makedirty(ctx->role); /* low level lht_dom_node_alloc() wouldn't make user config to be saved! */ + pcb_conf_update("rc/library_search_paths", -1); + pcb_conf_makedirty(ctx->role); /* low level lht_dom_node_alloc() wouldn't make user config to be saved! */ if (ctx->role == CFR_DESIGN) pcb_board_set_changed_flag(1); @@ -439,7 +439,7 @@ void pcb_dlg_pref_lib_open(pref_ctx_t *ctx) { - conf_native_t *cn = conf_get_field("rc/library_search_paths"); + conf_native_t *cn = pcb_conf_get_field("rc/library_search_paths"); pref_lib_conf2dlg_post(cn, -1); } @@ -446,7 +446,7 @@ void pcb_dlg_pref_lib_init(pref_ctx_t *ctx) { static conf_hid_callbacks_t cbs_spth; - conf_native_t *cn = conf_get_field("rc/library_search_paths"); + conf_native_t *cn = pcb_conf_get_field("rc/library_search_paths"); if (cn != NULL) { memset(&cbs_spth, 0, sizeof(conf_hid_callbacks_t)); Index: trunk/src_plugins/dialogs/dlg_pref_sizes.c =================================================================== --- trunk/src_plugins/dialogs/dlg_pref_sizes.c (revision 26976) +++ trunk/src_plugins/dialogs/dlg_pref_sizes.c (revision 26977) @@ -80,7 +80,7 @@ double v = ctx->dlg[ctx->sizes.wisle].val.dbl * 1000000.0; ctx->sizes.lock++; - conf_setf(ctx->role, "design/poly_isle_area", -1, "%f", v); + pcb_conf_setf(ctx->role, "design/poly_isle_area", -1, "%f", v); ctx->sizes.lock--; } @@ -135,7 +135,7 @@ void pcb_dlg_pref_sizes_init(pref_ctx_t *ctx) { static conf_hid_callbacks_t cbs_isle; - conf_native_t *cn = conf_get_field("design/poly_isle_area"); + conf_native_t *cn = pcb_conf_get_field("design/poly_isle_area"); if (cn != NULL) { memset(&cbs_isle, 0, sizeof(conf_hid_callbacks_t)); Index: trunk/src_plugins/dialogs/dlg_pref_win.c =================================================================== --- trunk/src_plugins/dialogs/dlg_pref_win.c (revision 26976) +++ trunk/src_plugins/dialogs/dlg_pref_win.c (revision 26977) @@ -56,7 +56,7 @@ static void pref_win_master_cb(void *hid_ctx, void *caller_data, pcb_hid_attribute_t *attr) { pref_ctx_t *ctx = caller_data; - conf_setf(ctx->role, "editor/auto_place", -1, "%d", attr->val.lng); + pcb_conf_setf(ctx->role, "editor/auto_place", -1, "%d", attr->val.lng); pref_win_brd2dlg(ctx); } @@ -63,7 +63,7 @@ static void pref_win_board_cb(void *hid_ctx, void *caller_data, pcb_hid_attribute_t *attr) { pref_ctx_t *ctx = caller_data; - conf_setf(ctx->role, "plugins/dialogs/auto_save_window_geometry/to_design", -1, "%d", attr->val.lng); + pcb_conf_setf(ctx->role, "plugins/dialogs/auto_save_window_geometry/to_design", -1, "%d", attr->val.lng); pref_win_brd2dlg(ctx); } @@ -70,7 +70,7 @@ static void pref_win_project_cb(void *hid_ctx, void *caller_data, pcb_hid_attribute_t *attr) { pref_ctx_t *ctx = caller_data; - conf_setf(ctx->role, "plugins/dialogs/auto_save_window_geometry/to_project", -1, "%d", attr->val.lng); + pcb_conf_setf(ctx->role, "plugins/dialogs/auto_save_window_geometry/to_project", -1, "%d", attr->val.lng); pref_win_brd2dlg(ctx); } @@ -77,7 +77,7 @@ static void pref_win_user_cb(void *hid_ctx, void *caller_data, pcb_hid_attribute_t *attr) { pref_ctx_t *ctx = caller_data; - conf_setf(ctx->role, "plugins/dialogs/auto_save_window_geometry/to_user", -1, "%d", attr->val.lng); + pcb_conf_setf(ctx->role, "plugins/dialogs/auto_save_window_geometry/to_user", -1, "%d", attr->val.lng); pref_win_brd2dlg(ctx); } Index: trunk/src_plugins/djopt/djopt.c =================================================================== --- trunk/src_plugins/djopt/djopt.c (revision 26976) +++ trunk/src_plugins/djopt/djopt.c (revision 26977) @@ -2572,7 +2572,7 @@ void pplg_uninit_djopt(void) { pcb_remove_actions_by_cookie(djopt_cookie); - conf_unreg_fields("plugins/djopt/"); + pcb_conf_unreg_fields("plugins/djopt/"); } #include "dolists.h" @@ -2581,7 +2581,7 @@ PCB_API_CHK_VER; #define conf_reg(field,isarray,type_name,cpath,cname,desc,flags) \ - conf_reg_field(conf_djopt, field,isarray,type_name,cpath,cname,desc,flags); + pcb_conf_reg_field(conf_djopt, field,isarray,type_name,cpath,cname,desc,flags); #include "djopt_conf_fields.h" PCB_REGISTER_ACTIONS(djopt_action_list, djopt_cookie) Index: trunk/src_plugins/draw_fab/draw_fab.c =================================================================== --- trunk/src_plugins/draw_fab/draw_fab.c (revision 26976) +++ trunk/src_plugins/draw_fab/draw_fab.c (revision 26977) @@ -334,7 +334,7 @@ void pplg_uninit_draw_fab(void) { - conf_unreg_fields("plugins/draw_fab/"); + pcb_conf_unreg_fields("plugins/draw_fab/"); } int pplg_init_draw_fab(void) @@ -344,7 +344,7 @@ pcb_stub_draw_fab_overhang = DrawFab_overhang; #define conf_reg(field,isarray,type_name,cpath,cname,desc,flags) \ - conf_reg_field(conf_draw_fab, field,isarray,type_name,cpath,cname,desc,flags); + pcb_conf_reg_field(conf_draw_fab, field,isarray,type_name,cpath,cname,desc,flags); #include "draw_fab_conf_fields.h" Index: trunk/src_plugins/draw_fontsel/draw_fontsel.c =================================================================== --- trunk/src_plugins/draw_fontsel/draw_fontsel.c (revision 26976) +++ trunk/src_plugins/draw_fontsel/draw_fontsel.c (revision 26977) @@ -164,7 +164,7 @@ if (txt == NULL) { char sval[128]; sprintf(sval, "%ld", fid); - conf_set(CFR_DESIGN, "design/text_font_id", 0, sval, POL_OVERWRITE); + pcb_conf_set(CFR_DESIGN, "design/text_font_id", 0, sval, POL_OVERWRITE); } else { switch(txt->type) { Index: trunk/src_plugins/export_dxf/dxf.c =================================================================== --- trunk/src_plugins/export_dxf/dxf.c (revision 26976) +++ trunk/src_plugins/export_dxf/dxf.c (revision 26977) @@ -237,7 +237,7 @@ pcbhl_expose_main(&dxf_hid, &hectx, NULL); - conf_update(NULL, -1); /* restore forced sets */ + pcb_conf_update(NULL, -1); /* restore forced sets */ } int insert_hdr(FILE *f, const char *prefix, char *name, lht_err_t *err) Index: trunk/src_plugins/export_excellon/excellon.c =================================================================== --- trunk/src_plugins/export_excellon/excellon.c (revision 26976) +++ trunk/src_plugins/export_excellon/excellon.c (revision 26977) @@ -249,7 +249,7 @@ lastwidth = -1; finding_apertures = 0; pcbhl_expose_main(&excellon_hid, &ctx, NULL); - conf_update(NULL, -1); /* resotre forced sets */ + pcb_conf_update(NULL, -1); /* resotre forced sets */ if (excellon_cam.active) { @@ -465,7 +465,7 @@ { pcb_export_remove_opts_by_cookie(excellon_cookie); free(filename); - conf_unreg_fields("plugins/export_excellon/"); + pcb_conf_unreg_fields("plugins/export_excellon/"); } int pplg_init_export_excellon(void) @@ -473,7 +473,7 @@ PCB_API_CHK_VER; #define conf_reg(field,isarray,type_name,cpath,cname,desc,flags) \ - conf_reg_field(conf_excellon, field,isarray,type_name,cpath,cname,desc,flags); + pcb_conf_reg_field(conf_excellon, field,isarray,type_name,cpath,cname,desc,flags); #include "excellon_conf_fields.h" memset(&excellon_hid, 0, sizeof(excellon_hid)); Index: trunk/src_plugins/export_gerber/gerber.c =================================================================== --- trunk/src_plugins/export_gerber/gerber.c (revision 26976) +++ trunk/src_plugins/export_gerber/gerber.c (revision 26977) @@ -602,7 +602,7 @@ f = NULL; if (!gerber_cam.active) pcb_hid_restore_layer_ons(save_ons); - conf_update(NULL, -1); /* resotre forced sets */ + pcb_conf_update(NULL, -1); /* resotre forced sets */ if ((!gerber_cam.active) && (name_style != NAME_STYLE_PCB_RND)) { int purpi; @@ -1329,7 +1329,7 @@ void pplg_uninit_export_gerber(void) { pcb_export_remove_opts_by_cookie(gerber_cookie); - conf_unreg_fields("plugins/export_gerber/"); + pcb_conf_unreg_fields("plugins/export_gerber/"); } int pplg_init_export_gerber(void) @@ -1337,7 +1337,7 @@ PCB_API_CHK_VER; #define conf_reg(field,isarray,type_name,cpath,cname,desc,flags) \ - conf_reg_field(conf_gerber, field,isarray,type_name,cpath,cname,desc,flags); + pcb_conf_reg_field(conf_gerber, field,isarray,type_name,cpath,cname,desc,flags); #include "gerber_conf_fields.h" memset(&gerber_hid, 0, sizeof(gerber_hid)); Index: trunk/src_plugins/export_openems/export_openems.c =================================================================== --- trunk/src_plugins/export_openems/export_openems.c (revision 26976) +++ trunk/src_plugins/export_openems/export_openems.c (revision 26977) @@ -627,7 +627,7 @@ fprintf(wctx.f, "%%%%%% Port(s) on terminals\n"); openems_write_testpoints(&wctx, wctx.pcb->Data); - conf_update(NULL, -1); /* restore forced sets */ + pcb_conf_update(NULL, -1); /* restore forced sets */ } static void openems_do_export(pcb_hid_t *hid, pcb_hid_attr_val_t *options) Index: trunk/src_plugins/export_openscad/export_openscad.c =================================================================== --- trunk/src_plugins/export_openscad/export_openscad.c (revision 26976) +++ trunk/src_plugins/export_openscad/export_openscad.c (revision 26977) @@ -160,7 +160,7 @@ pcbhl_expose_main(&openscad_hid, &ctx, NULL); - conf_update(NULL, -1); /* restore forced sets */ + pcb_conf_update(NULL, -1); /* restore forced sets */ } static void scad_close_layer() Index: trunk/src_plugins/export_png/png.c =================================================================== --- trunk/src_plugins/export_png/png.c (revision 26976) +++ trunk/src_plugins/export_png/png.c (revision 26977) @@ -956,7 +956,7 @@ pcbhl_expose_main(&png_hid, &ctx, xform); memcpy(pcb_layer_stack, saved_layer_stack, sizeof(pcb_layer_stack)); - conf_update(NULL, -1); /* restore forced sets */ + pcb_conf_update(NULL, -1); /* restore forced sets */ } Index: trunk/src_plugins/export_ps/eps.c =================================================================== --- trunk/src_plugins/export_ps/eps.c (revision 26976) +++ trunk/src_plugins/export_ps/eps.c (revision 26977) @@ -310,7 +310,7 @@ eps_print_footer(f); memcpy(pcb_layer_stack, saved_layer_stack, sizeof(pcb_layer_stack)); - conf_update(NULL, -1); /* restore forced sets */ + pcb_conf_update(NULL, -1); /* restore forced sets */ options_ = NULL; } Index: trunk/src_plugins/export_ps/ps.c =================================================================== --- trunk/src_plugins/export_ps/ps.c (revision 26976) +++ trunk/src_plugins/export_ps/ps.c (revision 26977) @@ -603,7 +603,7 @@ fprintf(the_file, "showpage\n"); memcpy(pcb_layer_stack, saved_layer_stack, sizeof(pcb_layer_stack)); - conf_update(NULL, -1); /* restore forced sets */ + pcb_conf_update(NULL, -1); /* restore forced sets */ } static void ps_do_export(pcb_hid_t *hid, pcb_hid_attr_val_t *options) Index: trunk/src_plugins/export_svg/svg.c =================================================================== --- trunk/src_plugins/export_svg/svg.c (revision 26976) +++ trunk/src_plugins/export_svg/svg.c (revision 26977) @@ -265,7 +265,7 @@ pcbhl_expose_main(&svg_hid, &ctx, xform); - conf_update(NULL, -1); /* restore forced sets */ + pcb_conf_update(NULL, -1); /* restore forced sets */ } static void group_close() Index: trunk/src_plugins/export_xy/xy.c =================================================================== --- trunk/src_plugins/export_xy/xy.c (revision 26976) +++ trunk/src_plugins/export_xy/xy.c (revision 26977) @@ -842,8 +842,8 @@ void pplg_uninit_export_xy(void) { pcb_export_remove_opts_by_cookie(xy_cookie); - conf_unreg_file(CONF_FN, export_xy_conf_internal); - conf_unreg_fields("plugins/export_xy/"); + pcb_conf_unreg_file(CONF_FN, export_xy_conf_internal); + pcb_conf_unreg_fields("plugins/export_xy/"); free_fmts(); vts0_uninit(&fmt_names); vts0_uninit(&fmt_ids); @@ -854,12 +854,12 @@ { PCB_API_CHK_VER; - conf_reg_file(CONF_FN, export_xy_conf_internal); + pcb_conf_reg_file(CONF_FN, export_xy_conf_internal); memset(&xy_hid, 0, sizeof(pcb_hid_t)); #define conf_reg(field,isarray,type_name,cpath,cname,desc,flags) \ - conf_reg_field(conf_xy, field,isarray,type_name,cpath,cname,desc,flags); + pcb_conf_reg_field(conf_xy, field,isarray,type_name,cpath,cname,desc,flags); #include "xy_conf_fields.h" pcb_hid_nogui_init(&xy_hid); Index: trunk/src_plugins/fontmode/fontmode.c =================================================================== --- trunk/src_plugins/fontmode/fontmode.c (revision 26976) +++ trunk/src_plugins/fontmode/fontmode.c (revision 26977) @@ -115,7 +115,7 @@ if (pcb_actionl("New", "Font", 0)) return 1; - conf_set(CFR_DESIGN, "editor/grid_unit", -1, "mil", POL_OVERWRITE); + pcb_conf_set(CFR_DESIGN, "editor/grid_unit", -1, "mil", 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/fp_wget/fp_wget.c =================================================================== --- trunk/src_plugins/fp_wget/fp_wget.c (revision 26976) +++ trunk/src_plugins/fp_wget/fp_wget.c (revision 26977) @@ -14,10 +14,10 @@ void pplg_uninit_fp_wget(void) { - conf_unreg_file(FP_WGET_CONF_FN, fp_wget_conf_internal); + pcb_conf_unreg_file(FP_WGET_CONF_FN, fp_wget_conf_internal); fp_gedasymbols_uninit(); fp_edakrill_uninit(); - conf_unreg_fields("plugins/fp_wget/"); + pcb_conf_unreg_fields("plugins/fp_wget/"); } int pplg_init_fp_wget(void) @@ -25,10 +25,10 @@ PCB_API_CHK_VER; #define conf_reg(field,isarray,type_name,cpath,cname,desc,flags) \ - conf_reg_field(conf_fp_wget, field,isarray,type_name,cpath,cname,desc,flags); + pcb_conf_reg_field(conf_fp_wget, field,isarray,type_name,cpath,cname,desc,flags); #include "fp_wget_conf_fields.h" - conf_reg_file(FP_WGET_CONF_FN, fp_wget_conf_internal); + pcb_conf_reg_file(FP_WGET_CONF_FN, fp_wget_conf_internal); fp_gedasymbols_init(); fp_edakrill_init(); Index: trunk/src_plugins/hid_gtk3_cairo/gtkhid-cairo.c =================================================================== --- trunk/src_plugins/hid_gtk3_cairo/gtkhid-cairo.c (revision 26976) +++ trunk/src_plugins/hid_gtk3_cairo/gtkhid-cairo.c (revision 26977) @@ -602,10 +602,10 @@ // red = priv->grid_color.red; // green = priv->grid_color.green; // blue = priv->grid_color.blue; -// conf_setf(CFR_DESIGN, "appearance/color/grid", -1, "#%02x%02x%02x", red, green, blue); +// pcb_conf_setf(CFR_DESIGN, "appearance/color/grid", -1, "#%02x%02x%02x", red, green, blue); // map_color_string(pcbhl_conf.appearance.color.grid, &priv->grid_color); // -// config_color_button_update(&ghidgui->common, conf_get_field("appearance/color/grid"), -1); +// config_color_button_update(&ghidgui->common, pcb_conf_get_field("appearance/color/grid"), -1); // // //if (priv->grid_gc) // // gdk_gc_set_foreground(priv->grid_gc, &gport->grid_color); Index: trunk/src_plugins/hid_lesstif/main.c =================================================================== --- trunk/src_plugins/hid_lesstif/main.c (revision 26976) +++ trunk/src_plugins/hid_lesstif/main.c (revision 26977) @@ -2872,7 +2872,7 @@ #if 0 static void init_conf_watch(conf_hid_callbacks_t *cbs, const char *path, void (*func)(conf_native_t *, int)) { - conf_native_t *n = conf_get_field(path); + conf_native_t *n = pcb_conf_get_field(path); if (n != NULL) { memset(cbs, 0, sizeof(conf_hid_callbacks_t)); cbs->val_change_post = func; Index: trunk/src_plugins/hid_lesstif/menu.c =================================================================== --- trunk/src_plugins/hid_lesstif/menu.c (revision 26976) +++ trunk/src_plugins/hid_lesstif/menu.c (revision 26977) @@ -489,7 +489,7 @@ if (uo != NULL) { static conf_hid_callbacks_t cbs; static int cbs_inited = 0; - conf_native_t *nat = conf_get_field(uo); + conf_native_t *nat = pcb_conf_get_field(uo); if (nat != NULL) { if (!cbs_inited) { Index: trunk/src_plugins/import_mentor_sch/mentor_sch.c =================================================================== --- trunk/src_plugins/import_mentor_sch/mentor_sch.c (revision 26976) +++ trunk/src_plugins/import_mentor_sch/mentor_sch.c (revision 26977) @@ -290,7 +290,7 @@ void pplg_uninit_import_mentor_sch(void) { pcb_remove_actions_by_cookie(mentor_sch_cookie); - conf_unreg_fields("plugins/import_mentor_sch/"); + pcb_conf_unreg_fields("plugins/import_mentor_sch/"); } #include "dolists.h" @@ -299,7 +299,7 @@ PCB_API_CHK_VER; #define conf_reg(field,isarray,type_name,cpath,cname,desc,flags) \ - conf_reg_field(conf_mentor, field,isarray,type_name,cpath,cname,desc,flags); + pcb_conf_reg_field(conf_mentor, field,isarray,type_name,cpath,cname,desc,flags); #include "mentor_sch_conf_fields.h" PCB_REGISTER_ACTIONS(mentor_sch_action_list, mentor_sch_cookie) Index: trunk/src_plugins/import_sch/import_sch.c =================================================================== --- trunk/src_plugins/import_sch/import_sch.c (revision 26976) +++ trunk/src_plugins/import_sch/import_sch.c (revision 26977) @@ -385,7 +385,7 @@ void pplg_uninit_import_sch(void) { pcb_remove_actions_by_cookie(import_sch_cookie); - conf_unreg_fields("plugins/import_sch/"); + pcb_conf_unreg_fields("plugins/import_sch/"); } #include "dolists.h" @@ -396,17 +396,17 @@ PCB_API_CHK_VER; PCB_REGISTER_ACTIONS(import_sch_action_list, import_sch_cookie) #define conf_reg(field,isarray,type_name,cpath,cname,desc,flags) \ - conf_reg_field(conf_import_sch, field,isarray,type_name,cpath,cname,desc,flags); + pcb_conf_reg_field(conf_import_sch, field,isarray,type_name,cpath,cname,desc,flags); #include "import_sch_conf_fields.h" /* Compatibility: get some settings from the env */ tmp = getenv ("PCB_MAKE_PROGRAM"); if (tmp != NULL) - conf_set(CFR_ENV, "plugins/import_sch/make_program", -1, tmp, POL_OVERWRITE); + pcb_conf_set(CFR_ENV, "plugins/import_sch/make_program", -1, tmp, POL_OVERWRITE); tmp = getenv ("PCB_GNETLIST"); if (tmp != NULL) - conf_set(CFR_ENV, "plugins/import_sch/gnetlist_program", -1, tmp, POL_OVERWRITE); + pcb_conf_set(CFR_ENV, "plugins/import_sch/gnetlist_program", -1, tmp, POL_OVERWRITE); return 0; } Index: trunk/src_plugins/io_eagle/read_dru.c =================================================================== --- trunk/src_plugins/io_eagle/read_dru.c (revision 26976) +++ trunk/src_plugins/io_eagle/read_dru.c (revision 26977) @@ -154,7 +154,7 @@ return; } if (d > curr_val) - conf_set(CFR_DESIGN, "design/min_drill", -1, val, POL_OVERWRITE); + pcb_conf_set(CFR_DESIGN, "design/min_drill", -1, val, 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; - conf_set(CFR_DESIGN, "design/bloat", -1, "0", POL_OVERWRITE); - conf_set(CFR_DESIGN, "design/min_wid", -1, "0", POL_OVERWRITE); - conf_set(CFR_DESIGN, "design/min_drill", -1, "0", POL_OVERWRITE); + 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); memcpy(tmp, prefix, sizeof(prefix)); Index: trunk/src_plugins/io_lihata/io_lihata.c =================================================================== --- trunk/src_plugins/io_lihata/io_lihata.c (revision 26976) +++ trunk/src_plugins/io_lihata/io_lihata.c (revision 26977) @@ -59,7 +59,7 @@ void pplg_uninit_io_lihata(void) { - conf_unreg_fields("plugins/io_lihata/"); + pcb_conf_unreg_fields("plugins/io_lihata/"); PCB_HOOK_UNREGISTER(pcb_plug_io_t, pcb_plug_io_chain, &plug_io_lihata_v6); PCB_HOOK_UNREGISTER(pcb_plug_io_t, pcb_plug_io_chain, &plug_io_lihata_v5); PCB_HOOK_UNREGISTER(pcb_plug_io_t, pcb_plug_io_chain, &plug_io_lihata_v4); @@ -210,7 +210,7 @@ PCB_HOOK_REGISTER(pcb_plug_io_t, pcb_plug_io_chain, &plug_io_lihata_v1); #define conf_reg(field,isarray,type_name,cpath,cname,desc,flags) \ - conf_reg_field(conf_io_lihata, field,isarray,type_name,cpath,cname,desc,flags); + pcb_conf_reg_field(conf_io_lihata, field,isarray,type_name,cpath,cname,desc,flags); #include "lht_conf_fields.h" return 0; Index: trunk/src_plugins/io_lihata/read.c =================================================================== --- trunk/src_plugins/io_lihata/read.c (revision 26976) +++ trunk/src_plugins/io_lihata/read.c (revision 26977) @@ -381,7 +381,7 @@ if (parse_coord(&tmp, nd) != 0) return -1; - conf_set(CFR_DESIGN, path, -1, nd->data.text.value, POL_OVERWRITE); + pcb_conf_set(CFR_DESIGN, path, -1, nd->data.text.value, POL_OVERWRITE); return 0; } @@ -2212,10 +2212,10 @@ static void parse_conf(pcb_board_t *pcb, lht_node_t *sub) { - if (conf_insert_tree_as(CFR_DESIGN, sub) != 0) + if (pcb_conf_insert_tree_as(CFR_DESIGN, sub) != 0) pcb_message(PCB_MSG_ERROR, "Failed to insert the config subtree '%s' found in %s\n", sub->name, pcb->hidlib.filename); else - conf_update(NULL, -1); + pcb_conf_update(NULL, -1); } Index: trunk/src_plugins/io_lihata/write.c =================================================================== --- trunk/src_plugins/io_lihata/write.c (revision 26976) +++ trunk/src_plugins/io_lihata/write.c (revision 26977) @@ -1395,7 +1395,7 @@ return nls; } -extern lht_doc_t *conf_main_root[CFR_max_alloc]; +extern lht_doc_t *pcb_conf_main_root[CFR_max_alloc]; static lht_node_t *build_conf() { const char **s, *del_paths[] = { "editor/mode", NULL }; @@ -1404,10 +1404,10 @@ if (conf_io_lihata.plugins.io_lihata.omit_config) return dummy_node("pcb-rnd-conf-v1"); - if ((conf_main_root[CFR_DESIGN] == NULL) || (conf_main_root[CFR_DESIGN]->root == NULL) || (conf_main_root[CFR_DESIGN]->root->type != LHT_LIST)) + if ((pcb_conf_main_root[CFR_DESIGN] == NULL) || (pcb_conf_main_root[CFR_DESIGN]->root == NULL) || (pcb_conf_main_root[CFR_DESIGN]->root->type != LHT_LIST)) return lht_dom_node_alloc(LHT_LIST, "pcb-rnd-conf-v1"); - res = lht_dom_duptree(conf_main_root[CFR_DESIGN]->root); + res = lht_dom_duptree(pcb_conf_main_root[CFR_DESIGN]->root); for(n = res->data.list.first; n != NULL; n = n->next) { for(s = del_paths; *s != NULL; s++) { @@ -1772,13 +1772,13 @@ int omit_styles = !!sub->dlg[save->womit_styles].val.lng; if (omit_font != !!conf_io_lihata.plugins.io_lihata.omit_font) - conf_setf(CFR_CLI, "plugins/io_lihata/omit_font", 0, "%d", omit_font); + pcb_conf_setf(CFR_CLI, "plugins/io_lihata/omit_font", 0, "%d", omit_font); if (omit_config != !!conf_io_lihata.plugins.io_lihata.omit_config) - conf_setf(CFR_CLI, "plugins/io_lihata/omit_config", 0, "%d", omit_config); + pcb_conf_setf(CFR_CLI, "plugins/io_lihata/omit_config", 0, "%d", omit_config); if (omit_styles != !!conf_io_lihata.plugins.io_lihata.omit_styles) - conf_setf(CFR_CLI, "plugins/io_lihata/omit_styles", 0, "%d", omit_styles); + pcb_conf_setf(CFR_CLI, "plugins/io_lihata/omit_styles", 0, "%d", omit_styles); } free(save); Index: trunk/src_plugins/io_pcb/attribs.c =================================================================== --- trunk/src_plugins/io_pcb/attribs.c (revision 26976) +++ trunk/src_plugins/io_pcb/attribs.c (revision 26977) @@ -74,13 +74,13 @@ continue; } if (n->type == LHT_TEXT) { - conf_native_t *nv = conf_get_field(path); + conf_native_t *nv = pcb_conf_get_field(path); if ((nv != NULL) && (!nv->random_flags.io_pcb_no_attrib)) pcb_attribute_put(&pcb->Attributes, apath, n->data.text.value); } else if (n->type == LHT_LIST) { lht_node_t *i; - conf_native_t *nv = conf_get_field(path); + conf_native_t *nv = pcb_conf_get_field(path); if ((nv != NULL) && (!nv->random_flags.io_pcb_no_attrib)) { gds_t conc; gds_init(&conc); @@ -100,7 +100,7 @@ void io_pcb_attrib_c2a(pcb_board_t *pcb) { - lht_node_t *nmain = conf_lht_get_first(CFR_DESIGN, 0); + lht_node_t *nmain = pcb_conf_lht_get_first(CFR_DESIGN, 0); c2a(pcb, nmain, ""); } @@ -111,7 +111,7 @@ for (n = 0; n < pcb->Attributes.Number; n++) { if (path_ok(pcb->Attributes.List[n].name)) { - conf_native_t *nv = conf_get_field(pcb->Attributes.List[n].name + conf_attr_prefix_len); + conf_native_t *nv = pcb_conf_get_field(pcb->Attributes.List[n].name + conf_attr_prefix_len); if (nv == NULL) continue; if (nv->type == CFN_LIST) { @@ -123,12 +123,12 @@ *next = '\0'; next += strlen(LISTSEP); } - 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, POL_APPEND); } free(tmp); } else /* assume plain string */ - 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, POL_OVERWRITE); } } } Index: trunk/src_plugins/io_pcb/file.c =================================================================== --- trunk/src_plugins/io_pcb/file.c (revision 26976) +++ trunk/src_plugins/io_pcb/file.c (revision 26977) @@ -239,7 +239,7 @@ static void conf_update_pcb_flag(pcb_flag_t *dest, const char *hash_path, int binflag) { - conf_native_t *n = conf_get_field(hash_path); + conf_native_t *n = pcb_conf_get_field(hash_path); struct { pcb_flag_t Flags; } *tmp = (void *)dest; Index: trunk/src_plugins/io_pcb/parse_l.c =================================================================== --- trunk/src_plugins/io_pcb/parse_l.c (revision 26976) +++ trunk/src_plugins/io_pcb/parse_l.c (revision 26977) @@ -2499,7 +2499,7 @@ have hardwired flags again in a "don't save these in attributes" list. */ #define CONF_NO_ATTRIB(path) \ do { \ - conf_native_t *n = conf_get_field(path); \ + conf_native_t *n = pcb_conf_get_field(path); \ if (n != NULL) \ n->random_flags.io_pcb_no_attrib = 1; \ } while(0) \ @@ -2507,7 +2507,7 @@ #define CONF_SET(target, path, arr_idx, new_val, pol) \ do { \ CONF_NO_ATTRIB(path); \ - conf_set(target, path, arr_idx, new_val, pol); \ + pcb_conf_set(target, path, arr_idx, new_val, pol); \ } while(0) \ int io_pcb_ParsePCB(pcb_plug_io_t *ctx, pcb_board_t *Ptr, const char *Filename, conf_role_t settings_dest) @@ -2524,7 +2524,7 @@ yy_settings_dest = settings_dest; if (settings_dest != CFR_invalid) - conf_reset(settings_dest, Filename); + pcb_conf_reset(settings_dest, Filename); io_pcb_preproc_board(PCB); @@ -2569,7 +2569,7 @@ /* load config nodes not disabled above, from optional attributes */ io_pcb_attrib_a2c(Ptr); - conf_update(NULL, -1); + pcb_conf_update(NULL, -1); } if (retval == 0) { /* restore loader so the next save will use the same units */ Index: trunk/src_plugins/io_pcb/parse_l.l =================================================================== --- trunk/src_plugins/io_pcb/parse_l.l (revision 26976) +++ trunk/src_plugins/io_pcb/parse_l.l (revision 26977) @@ -356,7 +356,7 @@ have hardwired flags again in a "don't save these in attributes" list. */ #define CONF_NO_ATTRIB(path) \ do { \ - conf_native_t *n = conf_get_field(path); \ + conf_native_t *n = pcb_conf_get_field(path); \ if (n != NULL) \ n->random_flags.io_pcb_no_attrib = 1; \ } while(0) \ @@ -364,7 +364,7 @@ #define CONF_SET(target, path, arr_idx, new_val, pol) \ do { \ CONF_NO_ATTRIB(path); \ - conf_set(target, path, arr_idx, new_val, pol); \ + pcb_conf_set(target, path, arr_idx, new_val, pol); \ } while(0) \ int io_pcb_ParsePCB(pcb_plug_io_t *ctx, pcb_board_t *Ptr, const char *Filename, conf_role_t settings_dest) @@ -381,7 +381,7 @@ yy_settings_dest = settings_dest; if (settings_dest != CFR_invalid) - conf_reset(settings_dest, Filename); + pcb_conf_reset(settings_dest, Filename); io_pcb_preproc_board(PCB); @@ -426,7 +426,7 @@ /* load config nodes not disabled above, from optional attributes */ io_pcb_attrib_a2c(Ptr); - conf_update(NULL, -1); + pcb_conf_update(NULL, -1); } if (retval == 0) { /* restore loader so the next save will use the same units */ Index: trunk/src_plugins/io_pcb/parse_y.c =================================================================== --- trunk/src_plugins/io_pcb/parse_y.c (revision 26976) +++ trunk/src_plugins/io_pcb/parse_y.c (revision 26977) @@ -1840,7 +1840,7 @@ { pcb_board_t *pcb_save = PCB; if ((yy_settings_dest != CFR_invalid) && (layer_group_string != NULL)) - 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, POL_OVERWRITE); pcb_board_new_postproc(yyPCB, 0); if (layer_group_string == NULL) { if (pcb_layer_improvise(yyPCB, pcb_true) != 0) { @@ -2013,9 +2013,9 @@ yyPCB->hidlib.grid_oy = OU ((yyvsp[-2].measure)); if (yy_settings_dest != CFR_invalid) { if ((yyvsp[-1].integer)) - conf_set(yy_settings_dest, "editor/draw_grid", -1, "true", POL_OVERWRITE); + pcb_conf_set(yy_settings_dest, "editor/draw_grid", -1, "true", POL_OVERWRITE); else - conf_set(yy_settings_dest, "editor/draw_grid", -1, "false", POL_OVERWRITE); + pcb_conf_set(yy_settings_dest, "editor/draw_grid", -1, "false", POL_OVERWRITE); } } #line 2022 "parse_y.c" /* yacc.c:1652 */ @@ -2029,9 +2029,9 @@ yyPCB->hidlib.grid_oy = NU ((yyvsp[-2].measure)); if (yy_settings_dest != CFR_invalid) { if ((yyvsp[-1].integer)) - conf_set(yy_settings_dest, "editor/draw_grid", -1, "true", POL_OVERWRITE); + pcb_conf_set(yy_settings_dest, "editor/draw_grid", -1, "true", POL_OVERWRITE); else - conf_set(yy_settings_dest, "editor/draw_grid", -1, "false", POL_OVERWRITE); + pcb_conf_set(yy_settings_dest, "editor/draw_grid", -1, "false", POL_OVERWRITE); } } #line 2038 "parse_y.c" /* yacc.c:1652 */ @@ -3347,7 +3347,7 @@ { char tmp[128]; pcb_sprintf(tmp, "%$mm", crd); - conf_set(CFR_DESIGN, path, -1, tmp, POL_OVERWRITE); + pcb_conf_set(CFR_DESIGN, path, -1, tmp, POL_OVERWRITE); } static void load_meta_float(const char *path, double val) @@ -3354,5 +3354,5 @@ { char tmp[128]; pcb_sprintf(tmp, "%f", val); - conf_set(CFR_DESIGN, path, -1, tmp, POL_OVERWRITE); + pcb_conf_set(CFR_DESIGN, path, -1, tmp, POL_OVERWRITE); } Index: trunk/src_plugins/io_pcb/parse_y.y =================================================================== --- trunk/src_plugins/io_pcb/parse_y.y (revision 26976) +++ trunk/src_plugins/io_pcb/parse_y.y (revision 26977) @@ -188,7 +188,7 @@ { pcb_board_t *pcb_save = PCB; if ((yy_settings_dest != CFR_invalid) && (layer_group_string != NULL)) - 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, POL_OVERWRITE); pcb_board_new_postproc(yyPCB, 0); if (layer_group_string == NULL) { if (pcb_layer_improvise(yyPCB, pcb_true) != 0) { @@ -345,9 +345,9 @@ yyPCB->hidlib.grid_oy = OU ($5); if (yy_settings_dest != CFR_invalid) { if ($6) - conf_set(yy_settings_dest, "editor/draw_grid", -1, "true", POL_OVERWRITE); + pcb_conf_set(yy_settings_dest, "editor/draw_grid", -1, "true", POL_OVERWRITE); else - conf_set(yy_settings_dest, "editor/draw_grid", -1, "false", POL_OVERWRITE); + pcb_conf_set(yy_settings_dest, "editor/draw_grid", -1, "false", POL_OVERWRITE); } } ; @@ -360,9 +360,9 @@ yyPCB->hidlib.grid_oy = NU ($5); if (yy_settings_dest != CFR_invalid) { if ($6) - conf_set(yy_settings_dest, "editor/draw_grid", -1, "true", POL_OVERWRITE); + pcb_conf_set(yy_settings_dest, "editor/draw_grid", -1, "true", POL_OVERWRITE); else - conf_set(yy_settings_dest, "editor/draw_grid", -1, "false", POL_OVERWRITE); + pcb_conf_set(yy_settings_dest, "editor/draw_grid", -1, "false", POL_OVERWRITE); } } ; @@ -1443,7 +1443,7 @@ { char tmp[128]; pcb_sprintf(tmp, "%$mm", crd); - conf_set(CFR_DESIGN, path, -1, tmp, POL_OVERWRITE); + pcb_conf_set(CFR_DESIGN, path, -1, tmp, POL_OVERWRITE); } static void load_meta_float(const char *path, double val) @@ -1450,5 +1450,5 @@ { char tmp[128]; pcb_sprintf(tmp, "%f", val); - conf_set(CFR_DESIGN, path, -1, tmp, POL_OVERWRITE); + pcb_conf_set(CFR_DESIGN, path, -1, tmp, POL_OVERWRITE); } Index: trunk/src_plugins/io_tedax/tdrc.c =================================================================== --- trunk/src_plugins/io_tedax/tdrc.c (revision 26976) +++ trunk/src_plugins/io_tedax/tdrc.c (revision 26977) @@ -62,7 +62,7 @@ fputc('\n', f); for(n = 0, r = rules; n < NUM_RULES; r++,n++) { - conf_native_t *nat = conf_get_field(r->conf); + conf_native_t *nat = pcb_conf_get_field(r->conf); if ((nat == NULL) || (nat->prop->src == NULL)) continue; pcb_fprintf(f, " rule all %s %s %.06mm pcb_rnd_old_drc_from_conf\n", r->ttype, r->tkind, nat->val.coord[0]); @@ -124,7 +124,7 @@ } for(n = 0, r = rules; n < NUM_RULES; r++,n++) - conf_setf(CFR_DESIGN, r->conf, -1, "%$mm", val[n]); + pcb_conf_setf(CFR_DESIGN, r->conf, -1, "%$mm", val[n]); return 0; } Index: trunk/src_plugins/lib_gtk_common/bu_menu.c =================================================================== --- trunk/src_plugins/lib_gtk_common/bu_menu.c (revision 26976) +++ trunk/src_plugins/lib_gtk_common/bu_menu.c (revision 26977) @@ -167,9 +167,9 @@ gtk_toggle_action_set_draw_as_radio(GTK_TOGGLE_ACTION(action), ! !strchr(checked, '=')); if (update_on != NULL) - nat = conf_get_field(update_on); + nat = pcb_conf_get_field(update_on); else - nat = conf_get_field(checked); + nat = pcb_conf_get_field(checked); if (nat != NULL) { static conf_hid_callbacks_t cbs; Index: trunk/src_plugins/lib_gtk_common/dlg_topwin.c =================================================================== --- trunk/src_plugins/lib_gtk_common/dlg_topwin.c (revision 26976) +++ trunk/src_plugins/lib_gtk_common/dlg_topwin.c (revision 26977) @@ -245,7 +245,7 @@ static void fullscreen_cb(GtkButton *btn, void *data) { - 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, POL_OVERWRITE); } /* XPM */ Index: trunk/src_plugins/lib_gtk_common/glue_common.c =================================================================== --- trunk/src_plugins/lib_gtk_common/glue_common.c (revision 26976) +++ trunk/src_plugins/lib_gtk_common/glue_common.c (revision 26977) @@ -116,7 +116,7 @@ static void init_conf_watch(conf_hid_callbacks_t *cbs, const char *path, void (*func)(conf_native_t *, int)) { - conf_native_t *n = conf_get_field(path); + conf_native_t *n = pcb_conf_get_field(path); if (n != NULL) { memset(cbs, 0, sizeof(conf_hid_callbacks_t)); cbs->val_change_post = func; Index: trunk/src_plugins/lib_gtk_common/glue_hid.c =================================================================== --- trunk/src_plugins/lib_gtk_common/glue_hid.c (revision 26976) +++ trunk/src_plugins/lib_gtk_common/glue_hid.c (revision 26977) @@ -231,7 +231,7 @@ #endif - conf_parse_arguments("plugins/hid_gtk/", argc, argv); + pcb_conf_parse_arguments("plugins/hid_gtk/", argc, argv); if (!gtk_init_check(argc, argv)) { fprintf(stderr, "gtk_init_check() fail - maybe $DISPLAY not set or X/GUI not accessible?\n"); @@ -358,7 +358,7 @@ static int ghid_usage(pcb_hid_t *hid, const char *topic) { fprintf(stderr, "\nGTK GUI command line arguments:\n\n"); - conf_usage("plugins/hid_gtk", pcb_hid_usage_option); + pcb_conf_usage("plugins/hid_gtk", pcb_hid_usage_option); fprintf(stderr, "\nInvocation:\n"); fprintf(stderr, " pcb-rnd --gui gtk2_gdk [options]\n"); fprintf(stderr, " pcb-rnd --gui gtk2_gl [options]\n"); Index: trunk/src_plugins/lib_gtk_common/lib_gtk_config.c =================================================================== --- trunk/src_plugins/lib_gtk_common/lib_gtk_config.c (revision 26976) +++ trunk/src_plugins/lib_gtk_common/lib_gtk_config.c (revision 26977) @@ -42,7 +42,7 @@ void pcb_gtk_conf_uninit(void) { conf_hid_unreg(lib_gtk_config_cookie); - conf_unreg_fields("plugins/hid_gtk/"); + pcb_conf_unreg_fields("plugins/hid_gtk/"); } /* Config paths that got removed but can be converted. Pairs of old,new strings */ @@ -100,7 +100,7 @@ ghid_conf_id = conf_hid_reg(lib_gtk_config_cookie, NULL); #define conf_reg(field,isarray,type_name,cpath,cname,desc,flags) \ - conf_reg_field(conf_hid_gtk, field,isarray,type_name,cpath,cname,desc,flags); + pcb_conf_reg_field(conf_hid_gtk, field,isarray,type_name,cpath,cname,desc,flags); #include "../src_plugins/lib_gtk_common/hid_gtk_conf_fields.h" /* check for legacy win geo settings */ @@ -108,8 +108,8 @@ conf_native_t *nat; char *end, dirname[128]; - conf_update(p[0], -1); - nat = conf_get_field(p[0]); + pcb_conf_update(p[0], -1); + nat = pcb_conf_get_field(p[0]); if ((nat == NULL) || (nat->prop->src == NULL)) continue; if (!warned) { @@ -122,10 +122,10 @@ end = strrchr(dirname, '/'); assert(end != NULL); *end = '\0'; - if (conf_get_field(p[1]) == NULL) - conf_reg_field_(&dummy_gtk_conf_init, 1, CFN_INTEGER, p[1], "", 0); - r = conf_lookup_role(nat->prop->src); - conf_setf(r, p[1], -1, "%d", nat->val.integer[0]); + if (pcb_conf_get_field(p[1]) == NULL) + pcb_conf_reg_field_(&dummy_gtk_conf_init, 1, CFN_INTEGER, p[1], "", 0); + r = pcb_conf_lookup_role(nat->prop->src); + pcb_conf_setf(r, p[1], -1, "%d", nat->val.integer[0]); dirty[r] = 1; } for(r = 0; r < CFR_max_real; r++) Index: trunk/src_plugins/lib_hid_common/grid_menu.c =================================================================== --- trunk/src_plugins/lib_hid_common/grid_menu.c (revision 26976) +++ trunk/src_plugins/lib_hid_common/grid_menu.c (revision 26977) @@ -49,7 +49,7 @@ char act[256], chk[256]; int idx; - nat = conf_get_field("editor/grids"); + nat = pcb_conf_get_field("editor/grids"); if (nat == NULL) return; Index: trunk/src_plugins/lib_hid_common/lib_hid_common.c =================================================================== --- trunk/src_plugins/lib_hid_common/lib_hid_common.c (revision 26976) +++ trunk/src_plugins/lib_hid_common/lib_hid_common.c (revision 26977) @@ -79,7 +79,7 @@ void pplg_uninit_lib_hid_common(void) { - conf_unreg_file(DIALOGS_CONF_FN, dialogs_conf_internal); + pcb_conf_unreg_file(DIALOGS_CONF_FN, dialogs_conf_internal); pcb_clihist_save(); pcb_clihist_uninit(); pcb_event_unbind_allcookie(grid_cookie); @@ -89,7 +89,7 @@ pcb_dialog_place_uninit(); pcb_remove_actions_by_cookie(hid_common_cookie); pcb_act_dad_uninit(); - conf_unreg_fields("plugins/lib_hid_common/"); + pcb_conf_unreg_fields("plugins/lib_hid_common/"); pcb_dlg_log_uninit(); } @@ -102,7 +102,7 @@ PCB_API_CHK_VER; #define conf_reg(field,isarray,type_name,cpath,cname,desc,flags) \ - conf_reg_field(dialogs_conf, field,isarray,type_name,cpath,cname,desc,flags); + pcb_conf_reg_field(dialogs_conf, field,isarray,type_name,cpath,cname,desc,flags); /*#include "lib_hid_common_conf_fields.h"*/ #include "dialogs_conf_fields.h" @@ -110,7 +110,7 @@ PCB_REGISTER_ACTIONS(hid_common_action_list, hid_common_cookie) pcb_act_dad_init(); - conf_reg_file(DIALOGS_CONF_FN, dialogs_conf_internal); + pcb_conf_reg_file(DIALOGS_CONF_FN, dialogs_conf_internal); pcb_dialog_place_init(); @@ -124,13 +124,13 @@ memset(&ccb, 0, sizeof(ccb)); ccb.val_change_post = pcb_grid_update_conf; - nat = conf_get_field("editor/grids"); + nat = pcb_conf_get_field("editor/grids"); if (nat != NULL) conf_hid_set_cb(nat, conf_id, &ccb); memset(&ccbu, 0, sizeof(ccbu)); ccbu.val_change_post = grid_unit_chg_ev; - nat = conf_get_field("editor/grid_unit"); + nat = pcb_conf_get_field("editor/grid_unit"); if (nat != NULL) conf_hid_set_cb(nat, conf_id, &ccbu); Index: trunk/src_plugins/lib_hid_common/menu_helper.c =================================================================== --- trunk/src_plugins/lib_hid_common/menu_helper.c (revision 26976) +++ trunk/src_plugins/lib_hid_common/menu_helper.c (revision 26977) @@ -52,7 +52,7 @@ cp = strchr(name, '('); if (cp == NULL) { - conf_native_t *n = conf_get_field(name); + conf_native_t *n = pcb_conf_get_field(name); if (n == NULL) return -1; if ((n->type != CFN_BOOLEAN) || (n->used != 1)) Index: trunk/src_plugins/lib_hid_common/place.c =================================================================== --- trunk/src_plugins/lib_hid_common/place.c (revision 26976) +++ trunk/src_plugins/lib_hid_common/place.c (revision 26977) @@ -122,23 +122,23 @@ { static int dummy; - if (conf_get_field(path) == NULL) - conf_reg_field_(&dummy, 1, CFN_INTEGER, str_cleanup_later(path), "", 0); - conf_setf(role, path, -1, "%d", val); + if (pcb_conf_get_field(path) == NULL) + pcb_conf_reg_field_(&dummy, 1, CFN_INTEGER, str_cleanup_later(path), "", 0); + pcb_conf_setf(role, path, -1, "%d", val); } static void place_conf_load(conf_role_t role, const char *path, int *val) { - conf_native_t *nat = conf_get_field(path); + conf_native_t *nat = pcb_conf_get_field(path); conf_role_t crole; static int dummy; - if (conf_get_field(path) == NULL) { - conf_reg_field_(&dummy, 1, CFN_INTEGER, str_cleanup_later(path), "", 0); - conf_update(path, -1); + if (pcb_conf_get_field(path) == NULL) { + pcb_conf_reg_field_(&dummy, 1, CFN_INTEGER, str_cleanup_later(path), "", 0); + pcb_conf_update(path, -1); } - nat = conf_get_field(path); + nat = pcb_conf_get_field(path); if ((nat == NULL) || (nat->prop->src == NULL) || (nat->prop->src->type != LHT_TEXT)) { pcb_message(PCB_MSG_ERROR, "Can not load window geometry from invalid node for %s\n", path); return; @@ -149,7 +149,7 @@ role matches the role that's being loaded. Else the currently loading role is lower prio and didn't contribute to the final values and should be ignored. */ - crole = conf_lookup_role(nat->prop->src); + crole = pcb_conf_lookup_role(nat->prop->src); if (crole != role) return; @@ -170,7 +170,7 @@ strcpy(path, BASEPATH); end = path + strlen(BASEPATH); - root = conf_lht_get_at(role, path, 0); + root = pcb_conf_lht_get_at(role, path, 0); if (root == NULL) return; @@ -227,9 +227,9 @@ if (role != CFR_DESIGN) { - int r = conf_save_file(hidlib, NULL, (hidlib == NULL ? NULL : hidlib->filename), role, NULL); + int r = pcb_conf_save_file(hidlib, NULL, (hidlib == NULL ? NULL : hidlib->filename), role, NULL); if (r != 0) - pcb_message(PCB_MSG_ERROR, "Failed to save window geometry in %s\n", conf_role_name(role)); + pcb_message(PCB_MSG_ERROR, "Failed to save window geometry in %s\n", pcb_conf_role_name(role)); } } @@ -292,7 +292,7 @@ htsw_entry_t *e; int n; - conf_unreg_fields(BASEPATH); + pcb_conf_unreg_fields(BASEPATH); place_maybe_save(NULL, CFR_USER, 0); Index: trunk/src_plugins/lib_hid_pcbui/lib_hid_pcbui.c =================================================================== --- trunk/src_plugins/lib_hid_pcbui/lib_hid_pcbui.c (revision 26976) +++ trunk/src_plugins/lib_hid_pcbui/lib_hid_pcbui.c (revision 26977) @@ -115,7 +115,7 @@ for(rp = paths, n = 0; *rp != NULL; rp++, n++) { memset(&cb[n], 0, sizeof(cb[0])); cb[n].val_change_post = update_cb; - nat = conf_get_field(*rp); + nat = pcb_conf_get_field(*rp); if (nat != NULL) conf_hid_set_cb(nat, conf_id, &cb[n]); } Index: trunk/src_plugins/lib_vfs/lib_vfs.c =================================================================== --- trunk/src_plugins/lib_vfs/lib_vfs.c (revision 26976) +++ trunk/src_plugins/lib_vfs/lib_vfs.c (revision 26977) @@ -506,7 +506,7 @@ static int vfs_access_conf(pcb_board_t *pcb, const char *path, gds_t *buff, int wr, int *isdir) { - conf_native_t *nat = conf_get_field(path); + conf_native_t *nat = pcb_conf_get_field(path); if (nat == NULL) { if (isdir != NULL) *isdir = 1; @@ -520,9 +520,9 @@ *isdir = 0; if (wr) - return conf_set(CFR_DESIGN, path, 0, buff->array, POL_OVERWRITE); + return pcb_conf_set(CFR_DESIGN, path, 0, buff->array, POL_OVERWRITE); else - conf_print_native((conf_pfn)vfs_conf_printf, buff, NULL, 0, nat); + pcb_conf_print_native((conf_pfn)vfs_conf_printf, buff, NULL, 0, nat); return 0; } Index: trunk/src_plugins/mincut/rats_mincut.c =================================================================== --- trunk/src_plugins/mincut/rats_mincut.c (revision 26976) +++ trunk/src_plugins/mincut/rats_mincut.c (revision 26977) @@ -360,7 +360,7 @@ void pplg_uninit_mincut(void) { - conf_unreg_fields("plugins/mincut/"); + pcb_conf_unreg_fields("plugins/mincut/"); pcb_event_unbind_allcookie(pcb_mincut_cookie); } @@ -371,7 +371,7 @@ pcb_event_bind(PCB_EVENT_NET_INDICATE_SHORT, pcb_mincut_ev, NULL, pcb_mincut_cookie); #define conf_reg(field,isarray,type_name,cpath,cname,desc,flags) \ - conf_reg_field(conf_mincut, field,isarray,type_name,cpath,cname,desc,flags); + pcb_conf_reg_field(conf_mincut, field,isarray,type_name,cpath,cname,desc,flags); #include "rats_mincut_conf_fields.h" return 0; } Index: trunk/src_plugins/oldactions/oldactions.c =================================================================== --- trunk/src_plugins/oldactions/oldactions.c (revision 26976) +++ trunk/src_plugins/oldactions/oldactions.c (revision 26977) @@ -48,7 +48,7 @@ static void conf_toggle(conf_role_t role, const char *path) { - conf_native_t *n = conf_get_field(path); + conf_native_t *n = pcb_conf_get_field(path); if (n == NULL) { pcb_message(PCB_MSG_ERROR, "Error: can't find config node %s to toggle\n", path); return; @@ -58,7 +58,7 @@ return; } - 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", 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) { - conf_set(CFR_DESIGN, "plugins/vendor/enable", -1, "1", POL_OVERWRITE); + pcb_conf_set(CFR_DESIGN, "plugins/vendor/enable", -1, "1", POL_OVERWRITE); PCB_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) { - conf_set(CFR_DESIGN, "plugins/vendor/enable", -1, "0", POL_OVERWRITE); + pcb_conf_set(CFR_DESIGN, "plugins/vendor/enable", -1, "0", POL_OVERWRITE); PCB_ACT_IRES(0); return 0; } Index: trunk/src_plugins/propedit/propdlg.c =================================================================== --- trunk/src_plugins/propedit/propdlg.c (revision 26976) +++ trunk/src_plugins/propedit/propdlg.c (revision 26977) @@ -665,7 +665,7 @@ void pcb_propdlg_init(void) { static conf_hid_callbacks_t cbs; - conf_native_t *n = conf_get_field("editor/grid_unit"); + conf_native_t *n = pcb_conf_get_field("editor/grid_unit"); propdlg_conf_id = conf_hid_reg(propdlg_cookie, NULL); if (n != NULL) { Index: trunk/src_plugins/renumber/renumber.c =================================================================== --- trunk/src_plugins/renumber/renumber.c (revision 26976) +++ trunk/src_plugins/renumber/renumber.c (revision 26977) @@ -298,7 +298,7 @@ fclose(out); /* restore the unique flag setting */ - conf_update(NULL, -1); + pcb_conf_update(NULL, -1); if (changed) { htsp_entry_t *e; Index: trunk/src_plugins/report/report.c =================================================================== --- trunk/src_plugins/report/report.c (revision 26976) +++ trunk/src_plugins/report/report.c (revision 26977) @@ -837,7 +837,7 @@ void pplg_uninit_report(void) { pcb_remove_actions_by_cookie(report_cookie); - conf_unreg_fields("plugins/report/"); + pcb_conf_unreg_fields("plugins/report/"); } #include "dolists.h" @@ -846,7 +846,7 @@ PCB_API_CHK_VER; PCB_REGISTER_ACTIONS(report_action_list, report_cookie) #define conf_reg(field,isarray,type_name,cpath,cname,desc,flags) \ - conf_reg_field(conf_report, field,isarray,type_name,cpath,cname,desc,flags); + pcb_conf_reg_field(conf_report, field,isarray,type_name,cpath,cname,desc,flags); #include "report_conf_fields.h" return 0; } Index: trunk/src_plugins/rubberband_orig/rubberband.c =================================================================== --- trunk/src_plugins/rubberband_orig/rubberband.c (revision 26976) +++ trunk/src_plugins/rubberband_orig/rubberband.c (revision 26977) @@ -1423,7 +1423,7 @@ void pplg_uninit_rubberband_orig(void) { pcb_event_unbind_allcookie(rubber_cookie); - conf_unreg_fields("plugins/rubberband_orig/"); + pcb_conf_unreg_fields("plugins/rubberband_orig/"); } int pplg_init_rubberband_orig(void) @@ -1440,7 +1440,7 @@ pcb_event_bind(PCB_EVENT_RUBBER_CONSTRAIN_MAIN_LINE, rbe_constrain_main_line, ctx, rubber_cookie); #define conf_reg(field,isarray,type_name,cpath,cname,desc,flags) \ - conf_reg_field(conf_rbo, field,isarray,type_name,cpath,cname,desc,flags); + pcb_conf_reg_field(conf_rbo, field,isarray,type_name,cpath,cname,desc,flags); #include "rubberband_conf_fields.h" return 0; Index: trunk/src_plugins/serpentine/serpentine.c =================================================================== --- trunk/src_plugins/serpentine/serpentine.c (revision 26976) +++ trunk/src_plugins/serpentine/serpentine.c (revision 26977) @@ -449,7 +449,7 @@ { pcb_remove_actions_by_cookie(serpentine_cookie); pcb_tool_unreg_by_cookie(serpentine_cookie); - conf_unreg_fields("plugins/serpentine/"); + pcb_conf_unreg_fields("plugins/serpentine/"); } #include "dolists.h" @@ -458,7 +458,7 @@ PCB_API_CHK_VER; PCB_REGISTER_ACTIONS(serpentine_action_list, serpentine_cookie) #define conf_reg(field,isarray,type_name,cpath,cname,desc,flags) \ - conf_reg_field(conf_serpentine, field,isarray,type_name,cpath,cname,desc,flags); + pcb_conf_reg_field(conf_serpentine, field,isarray,type_name,cpath,cname,desc,flags); #include "serpentine_conf_fields.h" pcb_tool_reg(&tool_serpentine, serpentine_cookie); Index: trunk/src_plugins/stroke/stroke.c =================================================================== --- trunk/src_plugins/stroke/stroke.c (revision 26976) +++ trunk/src_plugins/stroke/stroke.c (revision 26977) @@ -156,8 +156,8 @@ int pplg_uninit_stroke(void) { - conf_unreg_file(STROKE_CONF_FN, stroke_conf_internal); - conf_unreg_fields("plugins/stroke/"); + pcb_conf_unreg_file(STROKE_CONF_FN, stroke_conf_internal); + pcb_conf_unreg_fields("plugins/stroke/"); pcb_remove_actions_by_cookie(pcb_stroke_cookie); return 0; } @@ -168,10 +168,10 @@ { PCB_API_CHK_VER; stroke_init(); - conf_reg_file(STROKE_CONF_FN, stroke_conf_internal); + pcb_conf_reg_file(STROKE_CONF_FN, stroke_conf_internal); #define conf_reg(field,isarray,type_name,cpath,cname,desc,flags) \ - conf_reg_field(conf_stroke, field,isarray,type_name,cpath,cname,desc,flags); + pcb_conf_reg_field(conf_stroke, field,isarray,type_name,cpath,cname,desc,flags); #include "stroke_conf_fields.h" PCB_REGISTER_ACTIONS(stroke_action_list, pcb_stroke_cookie) Index: trunk/src_plugins/vendordrill/vendor.c =================================================================== --- trunk/src_plugins/vendordrill/vendor.c (revision 26976) +++ trunk/src_plugins/vendordrill/vendor.c (revision 26977) @@ -98,7 +98,7 @@ { char tmp[128]; pcb_sprintf(tmp, "%$mm", crd); - conf_set(CFR_DESIGN, path, -1, tmp, POL_OVERWRITE); + pcb_conf_set(CFR_DESIGN, path, -1, tmp, POL_OVERWRITE); } static pcb_bool vendorIsSubcMappable(pcb_subc_t *subc); @@ -271,7 +271,7 @@ pcb_message(PCB_MSG_INFO, "Loaded %d vendor drills from %s\n", n_vendor_drills, fname); pcb_message(PCB_MSG_INFO, "Loaded %d RefDes skips, %d Value skips, %d Descr skips\n", n_refdes, n_value, n_descr); - conf_set(CFR_DESIGN, "plugins/vendor/enable", -1, "0", POL_OVERWRITE); + pcb_conf_set(CFR_DESIGN, "plugins/vendor/enable", -1, "0", POL_OVERWRITE); apply_vendor_map(); if (free_fname) @@ -346,7 +346,7 @@ /* Update the current Via */ if (conf_core.design.via_drilling_hole != vendorDrillMap(conf_core.design.via_drilling_hole)) { changed++; - conf_setf(CFR_DESIGN, "design/via_drilling_hole", -1, "%$mm", vendorDrillMap(conf_core.design.via_drilling_hole)); + pcb_conf_setf(CFR_DESIGN, "design/via_drilling_hole", -1, "%$mm", vendorDrillMap(conf_core.design.via_drilling_hole)); pcb_message(PCB_MSG_INFO, "Adjusted active via hole size to be %ml mils\n", conf_core.design.via_drilling_hole); } @@ -662,7 +662,7 @@ pcb_event_unbind_allcookie(vendor_cookie); pcb_remove_actions_by_cookie(vendor_cookie); vendor_free_all(); - conf_unreg_fields("plugins/vendor/"); + pcb_conf_unreg_fields("plugins/vendor/"); } #include "dolists.h" @@ -670,7 +670,7 @@ { PCB_API_CHK_VER; #define conf_reg(field,isarray,type_name,cpath,cname,desc,flags) \ - conf_reg_field(conf_vendor, field,isarray,type_name,cpath,cname,desc,flags); + pcb_conf_reg_field(conf_vendor, field,isarray,type_name,cpath,cname,desc,flags); #include "vendor_conf_fields.h" pcb_event_bind(PCB_EVENT_NEW_PSTK, vendor_new_pstk, NULL, vendor_cookie); Index: trunk/tests/conf/conftest.c =================================================================== --- trunk/tests/conf/conftest.c (revision 26976) +++ trunk/tests/conf/conftest.c (revision 26977) @@ -89,7 +89,7 @@ conf_hid_callbacks_t global_cbs = {notify_pre, notify_post, NULL, NULL}; -extern lht_doc_t *conf_main_root[]; +extern lht_doc_t *pcb_conf_main_root[]; void cmd_dump(char *arg) { if (arg == NULL) { @@ -105,13 +105,13 @@ conf_role_t role; arg+=7; while(isspace(*arg)) arg++; - role = conf_role_parse(arg); + role = pcb_conf_role_parse(arg); if (role == CFR_invalid) { pcb_message(PCB_MSG_ERROR, "Invalid role: '%s'", arg); return; } - if (conf_main_root[role] != NULL) - lht_dom_export(conf_main_root[role]->root, stdout, ""); + if (pcb_conf_main_root[role] != NULL) + lht_dom_export(pcb_conf_main_root[role]->root, stdout, ""); else printf("\n"); } @@ -128,13 +128,13 @@ pcb_message(PCB_MSG_ERROR, "Need an arg: a native path"); return; } - node = conf_get_field(arg); + node = pcb_conf_get_field(arg); if (node == NULL) { pcb_message(PCB_MSG_ERROR, "No such path: '%s'", arg); return; } gds_init(&s); - conf_print_native((conf_pfn)pcb_append_printf, &s, NULL, 0, node); + pcb_conf_print_native((conf_pfn)pcb_append_printf, &s, NULL, 0, node); printf("%s='%s'\n", node->hash_path, s.array); gds_uninit(&s); } @@ -151,7 +151,7 @@ } if (*arg == '*') { - conf_load_all(NULL, NULL); + pcb_conf_load_all(NULL, NULL); return; } @@ -162,13 +162,13 @@ fn++; while(isspace(*fn)) fn++; - role = conf_role_parse(arg); + role = pcb_conf_role_parse(arg); if (role == CFR_invalid) { pcb_message(PCB_MSG_ERROR, "Invalid role: '%s'", arg); return; } - printf("Result: %d\n", conf_load_as(role, fn, is_text)); - conf_update(NULL, -1); + printf("Result: %d\n", pcb_conf_load_as(role, fn, is_text)); + pcb_conf_update(NULL, -1); } conf_policy_t current_policy = POL_OVERWRITE; @@ -176,7 +176,7 @@ void cmd_policy(char *arg) { - conf_policy_t np = conf_policy_parse(arg); + conf_policy_t np = pcb_conf_policy_parse(arg); if (np == POL_invalid) pcb_message(PCB_MSG_ERROR, "Invalid/unknown policy: '%s'", arg); else @@ -185,7 +185,7 @@ void cmd_role(char *arg) { - conf_role_t nr = conf_role_parse(arg); + conf_role_t nr = pcb_conf_role_parse(arg); if (nr == CFR_invalid) pcb_message(PCB_MSG_ERROR, "Invalid/unknown role: '%s'", arg); else @@ -202,7 +202,7 @@ pcb_message(PCB_MSG_ERROR, "Invalid integer prio: '%s'", arg); return; } - first = conf_lht_get_first(current_role, 0); + first = pcb_conf_lht_get_first(current_role, 0); if (first != NULL) { char tmp[128]; char *end; @@ -212,7 +212,7 @@ sprintf(tmp, "%s-%d", first->name, np); free(first->name); first->name = pcb_strdup(tmp); - conf_update(NULL, -1); + pcb_conf_update(NULL, -1); } } @@ -225,13 +225,13 @@ pcb_message(PCB_MSG_ERROR, "need a policy", arg); return; } - np = conf_policy_parse(arg); + np = pcb_conf_policy_parse(arg); if (np == POL_invalid) { pcb_message(PCB_MSG_ERROR, "Invalid integer policy: '%s'", arg); return; } - first = conf_lht_get_first(current_role, 0); + first = pcb_conf_lht_get_first(current_role, 0); if (first != NULL) { char tmp[128]; char *end; @@ -245,7 +245,7 @@ free(first->name); first->name = pcb_strdup(arg); } - conf_update(NULL, -1); + pcb_conf_update(NULL, -1); } } @@ -264,7 +264,7 @@ val++; while(isspace(*val) || (*val == '=')) val++; - res = conf_set(current_role, path, -1, val, current_policy); + res = pcb_conf_set(current_role, path, -1, val, current_policy); if (res != 0) printf("set error: %d\n", res); } @@ -271,7 +271,7 @@ void cmd_watch(char *arg, int add) { - conf_native_t *n = conf_get_field(arg); + conf_native_t *n = pcb_conf_get_field(arg); if (n == NULL) { pcb_message(PCB_MSG_ERROR, "unknown path"); return; @@ -299,22 +299,22 @@ void cmd_reset(char *arg) { if (arg == NULL) { - conf_reset(current_role, ""); + pcb_conf_reset(current_role, ""); } else if (*arg == '*') { int n; for(n = 0; n < CFR_max_real; n++) - conf_reset(n, ""); + pcb_conf_reset(n, ""); } else { - conf_role_t role = conf_role_parse(arg); + conf_role_t role = pcb_conf_role_parse(arg); if (role == CFR_invalid) { pcb_message(PCB_MSG_ERROR, "Invalid role: '%s'", arg); return; } - conf_reset(role, ""); + pcb_conf_reset(role, ""); } - conf_update(NULL, -1); + pcb_conf_update(NULL, -1); } extern void cmd_help(char *arg); @@ -363,11 +363,11 @@ hid_id = conf_hid_reg(hid_cookie, &global_cbs); - conf_init(); + pcb_conf_init(); conf_core_init(); pcb_hidlib_conf_init(); - conf_reset(CFR_SYSTEM, "
"); - conf_reset(CFR_USER, "
"); + pcb_conf_reset(CFR_SYSTEM, "
"); + pcb_conf_reset(CFR_USER, "
"); while(getline_cont(stdin)) { char *arg, *cmd = line; @@ -416,6 +416,6 @@ } conf_hid_unreg(hid_cookie); - conf_uninit(); + pcb_conf_uninit(); return 0; } Index: trunk/tests/conf/help.c =================================================================== --- trunk/tests/conf/help.c (revision 26976) +++ trunk/tests/conf/help.c (revision 26977) @@ -31,7 +31,7 @@ "Change the policy of the first confroot of the current role's in-memory lihata document to pol and merge. Pol is a policy, see: help policies", "set", "path value", - "Call conf_set() on a given path with the given value, using the current set-role and the current set-policy. See also: help role; help policy.", + "Call pcb_conf_set() on a given path with the given value, using the current set-role and the current set-policy. See also: help role; help policy.", "watch", "path", "Announce changes of a given path. See also: help unwatch", Index: trunk/util/gsch2pcb-rnd/gsch2pcb.c =================================================================== --- trunk/util/gsch2pcb-rnd/gsch2pcb.c (revision 26976) +++ trunk/util/gsch2pcb-rnd/gsch2pcb.c (revision 26977) @@ -118,7 +118,7 @@ const char *suff = loc_str_has_suffix(sch, ".sch", 4); if (suff != NULL) { char *tmp = pcb_strndup(sch, suff - sch); - 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, POL_OVERWRITE); free(tmp); } } @@ -162,23 +162,23 @@ if (!strcmp(config, "remove-unfound") || !strcmp(config, "r")) { /* This is default behavior set in header section */ - 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", POL_OVERWRITE); return 0; } if (!strcmp(config, "keep-unfound") || !strcmp(config, "k")) { - 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", POL_OVERWRITE); return 0; } if (!strcmp(config, "quiet") || !strcmp(config, "q")) { - 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", POL_OVERWRITE); return 0; } if (!strcmp(config, "preserve") || !strcmp(config, "p")) { - conf_set(CFR_CLI, "utils/gsch2pcb_rnd/preserve", -1, "1", POL_OVERWRITE); + pcb_conf_set(CFR_CLI, "utils/gsch2pcb_rnd/preserve", -1, "1", POL_OVERWRITE); return 0; } if (!strcmp(config, "elements-shell") || !strcmp(config, "s")) - conf_set(CFR_CLI, "rc/library_shell", -1, arg, POL_OVERWRITE); + pcb_conf_set(CFR_CLI, "rc/library_shell", -1, arg, POL_OVERWRITE); else if (!strcmp(config, "elements-dir") || !strcmp(config, "d")) { static int warned = 0; if (!warned) { @@ -185,12 +185,12 @@ pcb_message(PCB_MSG_WARNING, "WARNING: using elements-dir from %s - this overrides the normal pcb-rnd configured library search paths\n", config); warned = 1; } - conf_set(CFR_CLI, "rc/library_search_paths", -1, arg, POL_PREPEND); + pcb_conf_set(CFR_CLI, "rc/library_search_paths", -1, arg, POL_PREPEND); } else if (!strcmp(config, "output-name") || !strcmp(config, "o")) - 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, POL_OVERWRITE); else if (!strcmp(config, "default-pcb") || !strcmp(config, "P")) - 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, POL_OVERWRITE); else if (!strcmp(config, "schematics")) add_multiple_schematics(arg); else if (!strcmp(config, "gnetlist")) { @@ -200,7 +200,7 @@ gadl_append(&extra_gnetlist_list, n); } else if (!strcmp(config, "empty-footprint")) - 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, POL_OVERWRITE); else return -1; @@ -250,11 +250,11 @@ lihata_prj:; fclose(f); - if (conf_load_as(CFR_PROJECT, path, 0) != 0) { + if (pcb_conf_load_as(CFR_PROJECT, path, 0) != 0) { pcb_message(PCB_MSG_ERROR, "Failed to parse project file %s.\n", path); exit(1); } - conf_update(NULL, -1); /* because of our new project file */ + pcb_conf_update(NULL, -1); /* because of our new project file */ } static void load_extra_project_files(void) @@ -296,7 +296,7 @@ else if (!strcmp(opt, "verbose") || !strcmp(opt, "v")) { char tmp[64]; sprintf(tmp, "%ld", conf_g2pr.utils.gsch2pcb_rnd.verbose + 1); - conf_set(CFR_CLI, "utils/gsch2pcb_rnd/verbose", -1, tmp, POL_OVERWRITE); + pcb_conf_set(CFR_CLI, "utils/gsch2pcb_rnd/verbose", -1, tmp, POL_OVERWRITE); continue; } else if (!strcmp(opt, "m") || !strcmp(opt, "method")) { @@ -304,13 +304,13 @@ pcb_message(PCB_MSG_ERROR, "Error: can't use unknown method '%s'; try --help\n", arg); exit(1); } - conf_set(CFR_CLI, "utils/gsch2pcb_rnd/method", -1, arg, POL_OVERWRITE); + pcb_conf_set(CFR_CLI, "utils/gsch2pcb_rnd/method", -1, arg, POL_OVERWRITE); i++; continue; } else if (!strcmp(opt, "c") || !strcmp(opt, "conf")) { const char *stmp; - if (conf_set_from_cli(NULL, arg, NULL, &stmp) != 0) { + if (pcb_conf_set_from_cli(NULL, arg, NULL, &stmp) != 0) { fprintf(stderr, "Error: failed to set config %s: %s\n", arg, stmp); exit(1); } @@ -318,7 +318,7 @@ continue; } else if (!strcmp(opt, "fix-elements")) { - 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", POL_OVERWRITE); continue; } else if (!strcmp(opt, "gnetlist-arg")) { @@ -387,7 +387,7 @@ method_import_register(); - conf_init(); + pcb_conf_init(); conf_core_init(); pcb_hidlib_conf_init(); @@ -401,11 +401,11 @@ get_args(argc, argv); - conf_load_all(NULL, NULL); - conf_update(NULL, -1); + pcb_conf_load_all(NULL, NULL); + pcb_conf_update(NULL, -1); load_extra_project_files(); - conf_update(NULL, -1); /* because of CLI changes */ + pcb_conf_update(NULL, -1); /* because of CLI changes */ if (!have_cli_project_file && !have_cli_schematics) { if (!pcb_file_readable(LOCAL_PROJECT_FILE)) { @@ -412,17 +412,17 @@ pcb_message(PCB_MSG_ERROR, "Don't know what to do: no project or schematics given, no local project file %s found. Try %s --help\n", LOCAL_PROJECT_FILE, argv[0]); exit(1); } - if (conf_load_as(CFR_PROJECT, LOCAL_PROJECT_FILE, 0) != 0) { + if (pcb_conf_load_as(CFR_PROJECT, LOCAL_PROJECT_FILE, 0) != 0) { pcb_message(PCB_MSG_ERROR, "Failed to load project file %s. Try %s --help\n", LOCAL_PROJECT_FILE, argv[0]); exit(1); } - conf_update(NULL, -1); /* because of our new project file */ + pcb_conf_update(NULL, -1); /* because of our new project file */ } else if ((local_project_pcb_name != NULL) && (!have_cli_project_file)) - conf_load_project(NULL, local_project_pcb_name); + pcb_conf_load_project(NULL, local_project_pcb_name); if (!have_cli_schematics) { /* load all schematics from the project file unless we have schematics from the cli */ - conf_native_t *nat = conf_get_field("utils/gsch2pcb_rnd/schematics"); + conf_native_t *nat = pcb_conf_get_field("utils/gsch2pcb_rnd/schematics"); if (nat != NULL) { conf_listitem_t *ci; for (ci = conflist_first(nat->val.list); ci != NULL; ci = conflist_next(ci)) { @@ -443,7 +443,7 @@ exit(1); } - conf_update(NULL, -1); /* because of the project file */ + pcb_conf_update(NULL, -1); /* because of the project file */ want_method = conf_g2pr.utils.gsch2pcb_rnd.method; if (want_method == NULL) { @@ -472,7 +472,7 @@ } current_method->init(); - conf_update(NULL, -1); + pcb_conf_update(NULL, -1); current_method->go(); /* the traditional, "parse element and edit the pcb file" approach */ @@ -479,7 +479,7 @@ current_method->uninit(); - conf_uninit(); + pcb_conf_uninit(); free_strlist(&schematics); free_strlist(&extra_gnetlist_arg_list);