Index: conf/tests/scalar.ref =================================================================== --- conf/tests/scalar.ref (revision 36751) +++ conf/tests/scalar.ref (nonexistent) @@ -1,11 +0,0 @@ -=== initial state === - I rc/backup_name = <> conf_rev=0 -=== setting new values on higher prio should change the final render === - I rc/backup_name = from_user <:0>> conf_rev=0 - I rc/backup_name = from_design <:0>> conf_rev=1 - I rc/backup_name = from_cli <:0>> conf_rev=2 -=== setting new values on lower prio should NOT change the final render === - I rc/backup_name = from_cli <:0>> conf_rev=3 - I rc/backup_name = from_cli <:0>> conf_rev=4 -=== change prio to reorder === - I rc/backup_name = from_design2 <:0>> conf_rev=5 Index: conf/tests/arr_merge.test =================================================================== --- conf/tests/arr_merge.test (revision 36751) +++ conf/tests/arr_merge.test (nonexistent) @@ -1,55 +0,0 @@ -echo === initial state: empty === -reset * -dump native appearance/color/layer - -echo === import 3 levels === -paste system \ - li:pcb-rnd-conf-v1 { \ - ha:overwrite { \ - ha:appearance { \ - ha:color { \ - li:layer = {{#000001}; {#000002};} \ - } \ - } \ - } \ - } -dump native appearance/color/layer - -paste user \ - li:pcb-rnd-conf-v1 { \ - ha:overwrite { \ - ha:appearance { \ - ha:color { \ - li:layer = {{#000101}; {#000102};} \ - } \ - } \ - } \ - } -dump native appearance/color/layer - -paste design \ - li:pcb-rnd-conf-v1 { \ - ha:overwrite { \ - ha:appearance { \ - ha:color { \ - li:layer = {{#000201}; {#000201};} \ - } \ - } \ - } \ - } -dump native appearance/color/layer - -echo === change policy: design->prepend (2, 1) === -role design -chpolicy prepend -dump native appearance/color/layer - -echo === change policy: user->append (2, 0, 1) === -role user -chpolicy append -dump native appearance/color/layer - -echo === change policy: design->append (0, 1, 2) === -role design -chpolicy append -dump native appearance/color/layer Index: conf/tests/list_set.ref =================================================================== --- conf/tests/list_set.ref (revision 36751) +++ conf/tests/list_set.ref (nonexistent) @@ -1,10 +0,0 @@ -=== initial state: empty === - I rc/library_search_paths = <> conf_rev=0 -=== append two items === - I rc/library_search_paths = {foo <:0>>;} <> conf_rev=3 - I rc/library_search_paths = {foo <:0>>;bar <:0>>;} <> conf_rev=4 -=== prepend two items === - I rc/library_search_paths = {pre1 <:0>>;foo <:0>>;bar <:0>>;} <> conf_rev=5 - I rc/library_search_paths = {pre2 <:0>>;pre1 <:0>>;foo <:0>>;bar <:0>>;} <> conf_rev=6 -=== overwrite === - I rc/library_search_paths = {new <:0>>;} <> conf_rev=8 Index: conf/tests/scalar.test =================================================================== --- conf/tests/scalar.test (revision 36751) +++ conf/tests/scalar.test (nonexistent) @@ -1,29 +0,0 @@ -echo === initial state === -dump native rc/backup_name - -echo === setting new values on higher prio should change the final render === -role user -set rc/backup_name from_user -dump native rc/backup_name - -role design -set rc/backup_name from_design -dump native rc/backup_name - -role cli -set rc/backup_name from_cli -dump native rc/backup_name - -echo === setting new values on lower prio should NOT change the final render === -role user -set rc/backup_name from_user2 -dump native rc/backup_name - -role design -set rc/backup_name from_design2 -dump native rc/backup_name - -echo === change prio to reorder === -role cli -chprio 1 -dump native rc/backup_name Index: conf/tests/list_set.test =================================================================== --- conf/tests/list_set.test (revision 36751) +++ conf/tests/list_set.test (nonexistent) @@ -1,34 +0,0 @@ -role design - -echo === initial state: empty === -reset * -dump native rc/library_search_paths - -echo === append two items === -policy append - -set rc/library_search_paths foo -dump native rc/library_search_paths - -set rc/library_search_paths bar -dump native rc/library_search_paths - -echo === prepend two items === -policy prepend - -set rc/library_search_paths pre1 -dump native rc/library_search_paths - -set rc/library_search_paths pre2 -dump native rc/library_search_paths - -echo === overwrite === -policy overwrite - -set rc/library_search_paths new - -chprio 710 -# NOTE: have to raise priority because previous prepend and append subtrees also remain in the tree - -dump native rc/library_search_paths - Index: conf/tests/list_merge.ref =================================================================== --- conf/tests/list_merge.ref (revision 36751) +++ conf/tests/list_merge.ref (nonexistent) @@ -1,13 +0,0 @@ -=== initial state: empty === - I rc/library_search_paths = <> conf_rev=0 -=== import 3 levels === -Result: 0 - I rc/library_search_paths = {sys1 <>;sys2 <>;} <> conf_rev=3 -Result: 0 - I rc/library_search_paths = {user1 <>;user2 <>;} <> conf_rev=6 -Result: 0 - I rc/library_search_paths = {design1 <>;design2 <>;} <> conf_rev=9 -=== change policies === - I rc/library_search_paths = {design1 <>;design2 <>;user1 <>;user2 <>;} <> conf_rev=12 - I rc/library_search_paths = {design1 <>;design2 <>;sys1 <>;sys2 <>;user1 <>;user2 <>;} <> conf_rev=15 - I rc/library_search_paths = {sys1 <>;sys2 <>;user1 <>;user2 <>;design1 <>;design2 <>;} <> conf_rev=18 Index: conf/tests/list_merge.test =================================================================== --- conf/tests/list_merge.test (revision 36751) +++ conf/tests/list_merge.test (nonexistent) @@ -1,47 +0,0 @@ -echo === initial state: empty === -reset * -dump native rc/library_search_paths - -echo === import 3 levels === -paste system \ - li:pcb-rnd-conf-v1 { \ - ha:overwrite { \ - ha:rc { \ - li:library_search_paths = { sys1; sys2 } \ - } \ - } \ - } -dump native rc/library_search_paths - -paste user \ - li:pcb-rnd-conf-v1 { \ - ha:overwrite { \ - ha:rc { \ - li:library_search_paths = { user1; user2 } \ - } \ - } \ - } -dump native rc/library_search_paths - -paste design \ - li:pcb-rnd-conf-v1 { \ - ha:overwrite { \ - ha:rc { \ - li:library_search_paths = { design1; design2 } \ - } \ - } \ - } -dump native rc/library_search_paths - -echo === change policies === -role design -chpolicy prepend -dump native rc/library_search_paths - -role user -chpolicy append -dump native rc/library_search_paths - -role design -chpolicy append -dump native rc/library_search_paths Index: conf/tests/arr_set.ref =================================================================== --- conf/tests/arr_set.ref (revision 36751) +++ conf/tests/arr_set.ref (nonexistent) @@ -1,37 +0,0 @@ -=== initial state: empty === - I appearance/color/layer[] = -=== append two items === - I appearance/color/layer[0] = #000001 <:0>> conf_rev=3 - I appearance/color/layer[0] = #000001 <:0>> conf_rev=4 - I appearance/color/layer[1] = #000002 <:0>> conf_rev=4 -=== prepend two items === - I appearance/color/layer[0] = #000003 <:0>> conf_rev=5 - I appearance/color/layer[1] = #000001 <:0>> conf_rev=5 - I appearance/color/layer[2] = #000002 <:0>> conf_rev=5 - I appearance/color/layer[0] = #000004 <:0>> conf_rev=6 - I appearance/color/layer[1] = #000003 <:0>> conf_rev=6 - I appearance/color/layer[2] = #000001 <:0>> conf_rev=6 - I appearance/color/layer[3] = #000002 <:0>> conf_rev=6 -=== overwrite item === - I appearance/color/layer[0] = #000004 <:0>> conf_rev=10 - I appearance/color/layer[1] = #000005 <:0>> conf_rev=10 - I appearance/color/layer[2] = #000001 <:0>> conf_rev=10 - I appearance/color/layer[3] = #000002 <:0>> conf_rev=10 - I appearance/color/layer[0] = #000004 <:0>> conf_rev=11 - I appearance/color/layer[1] = #000005 <:0>> conf_rev=11 - I appearance/color/layer[2] = #000001 <:0>> conf_rev=11 - I appearance/color/layer[3] = #000002 <:0>> conf_rev=11 - I appearance/color/layer[4] = #000006 <:0>> conf_rev=11 - I appearance/color/layer[0] = #000004 <:0>> conf_rev=12 - I appearance/color/layer[1] = #000005 <:0>> conf_rev=12 - I appearance/color/layer[2] = #000001 <:0>> conf_rev=12 - I appearance/color/layer[3] = #000002 <:0>> conf_rev=12 - I appearance/color/layer[4] = #000006 <:0>> conf_rev=12 - I appearance/color/layer[5] = <> conf_rev=12 - I appearance/color/layer[6] = <> conf_rev=12 - I appearance/color/layer[7] = #000007 <:0>> conf_rev=12 -=== overwrite array === - I appearance/color/layer[0] = #000008 <:0>> conf_rev=16 - I appearance/color/layer[1] = #000003 <:0>> conf_rev=16 - I appearance/color/layer[2] = #000001 <:0>> conf_rev=16 - I appearance/color/layer[3] = #000002 <:0>> conf_rev=16 Index: conf/tests/arr_set.test =================================================================== --- conf/tests/arr_set.test (revision 36751) +++ conf/tests/arr_set.test (nonexistent) @@ -1,44 +0,0 @@ -role design - -echo === initial state: empty === -reset * -dump native appearance/color/layer - -echo === append two items === -policy append - -set appearance/color/layer #000001 -dump native appearance/color/layer - -set appearance/color/layer #000002 -dump native appearance/color/layer - -echo === prepend two items === -policy prepend - -set appearance/color/layer #000003 -dump native appearance/color/layer - -set appearance/color/layer #000004 -dump native appearance/color/layer - -echo === overwrite item === -policy overwrite -chprio 710 - -set appearance/color/layer[1] #000005 -dump native appearance/color/layer - -set appearance/color/layer[4] #000006 -dump native appearance/color/layer - -set appearance/color/layer[7] #000007 -dump native appearance/color/layer - - -echo === overwrite array === -policy overwrite -chprio 720 - -set appearance/color/layer #000008 -dump native appearance/color/layer Index: conf/tests/Makefile =================================================================== --- conf/tests/Makefile (revision 36751) +++ conf/tests/Makefile (nonexistent) @@ -1,26 +0,0 @@ -ROOT=../../.. -include $(ROOT)/Makefile.conf - -TESTS = \ - list_merge.diff \ - list_set.diff \ - arr_merge.diff \ - arr_set.diff \ - scalar.diff - -.SUFFIXES: .ref .test .out .diff .REF - -all: $(TESTS) - @echo "conf: *** QC PASS ***" - -.test.out: - @../conftest < $*.test >$*.out - -.test.REF: - @../conftest < $*.test >$*.ref - @echo $*.ref generated, please validate the content - -.out.diff: - @diff -u $*.ref $*.out - - Index: conf/tests/arr_merge.ref =================================================================== --- conf/tests/arr_merge.ref (revision 36751) +++ conf/tests/arr_merge.ref (nonexistent) @@ -1,31 +0,0 @@ -=== initial state: empty === - I appearance/color/layer[] = -=== import 3 levels === -Result: 0 - I appearance/color/layer[0] = #000001 <> conf_rev=3 - I appearance/color/layer[1] = #000002 <> conf_rev=3 -Result: 0 - I appearance/color/layer[0] = #000101 <> conf_rev=6 - I appearance/color/layer[1] = #000102 <> conf_rev=6 -Result: 0 - I appearance/color/layer[0] = #000201 <> conf_rev=9 - I appearance/color/layer[1] = #000201 <> conf_rev=9 -=== change policy: design->prepend (2, 1) === - I appearance/color/layer[0] = #000201 <> conf_rev=12 - I appearance/color/layer[1] = #000201 <> conf_rev=12 - I appearance/color/layer[2] = #000101 <> conf_rev=12 - I appearance/color/layer[3] = #000102 <> conf_rev=12 -=== change policy: user->append (2, 0, 1) === - I appearance/color/layer[0] = #000201 <> conf_rev=15 - I appearance/color/layer[1] = #000201 <> conf_rev=15 - I appearance/color/layer[2] = #000001 <> conf_rev=15 - I appearance/color/layer[3] = #000002 <> conf_rev=15 - I appearance/color/layer[4] = #000101 <> conf_rev=15 - I appearance/color/layer[5] = #000102 <> conf_rev=15 -=== change policy: design->append (0, 1, 2) === - I appearance/color/layer[0] = #000001 <> conf_rev=18 - I appearance/color/layer[1] = #000002 <> conf_rev=18 - I appearance/color/layer[2] = #000101 <> conf_rev=18 - I appearance/color/layer[3] = #000102 <> conf_rev=18 - I appearance/color/layer[4] = #000201 <> conf_rev=18 - I appearance/color/layer[5] = #000201 <> conf_rev=18 Index: conf/conftest.c =================================================================== --- conf/conftest.c (revision 36751) +++ conf/conftest.c (nonexistent) @@ -1,390 +0,0 @@ -#include -#include -#include -#include "config.h" -#include -#include -#include -#include -#include -#include -#include -#include "conf_core.h" -#include "src_plugins/diag/diag_conf.h" - -int lineno = 0; -int global_notify = 0; -rnd_conf_hid_id_t hid_id; -const char *hid_cookie = "conftest cookie"; - -const char *pcb_board_get_filename(void) -{ - return "dummy_brd.lht"; -} - -const char *pcb_board_get_name(void) -{ - return "dummy_brd"; -} - - -void watch_pre(rnd_conf_native_t *cfg, int idx) -{ - printf("watch_pre: '%s' old value\n", cfg->hash_path); -} - -void watch_post(rnd_conf_native_t *cfg, int idx) -{ - printf("watch_post: '%s' new value\n", cfg->hash_path); -} - -void notify_pre(rnd_conf_native_t *cfg, int idx) -{ - if (global_notify) - printf("notify_pre: '%s' old value\n", cfg->hash_path); -} - -void notify_post(rnd_conf_native_t *cfg, int idx) -{ - if (global_notify) - printf("notify_post: '%s' new value\n", cfg->hash_path); -} - -rnd_conf_hid_callbacks_t watch_cbs = {watch_pre, watch_post, NULL, NULL}; -rnd_conf_hid_callbacks_t global_cbs = {notify_pre, notify_post, NULL, NULL}; - - -extern lht_doc_t *rnd_conf_main_root[]; -extern void rnd_diag_conf_dump(FILE *f, const char *prefix, int verbose, const char *match_prefix); -void cmd_dump(char *arg) -{ - if (arg == NULL) { - rnd_message(RND_MSG_ERROR, "Need an arg: native or lihata"); - return; - } - if (strncmp(arg, "native", 6) == 0) { - arg+=7; - while(isspace(*arg)) arg++; - rnd_diag_conf_dump(stdout, "", 1, arg); - } - else if (strncmp(arg, "lihata", 6) == 0) { - rnd_conf_role_t role; - arg+=7; - while(isspace(*arg)) arg++; - role = rnd_conf_role_parse(arg); - if (role == RND_CFR_invalid) { - rnd_message(RND_MSG_ERROR, "Invalid role: '%s'", arg); - return; - } - if (rnd_conf_main_root[role] != NULL) - lht_dom_export(rnd_conf_main_root[role]->root, stdout, ""); - else - printf("\n"); - } - else - rnd_message(RND_MSG_ERROR, "Invalid dump mode: '%s'", arg); -} - -void cmd_print(char *arg) -{ - rnd_conf_native_t *node; - gds_t s; - - if (arg == NULL) { - rnd_message(RND_MSG_ERROR, "Need an arg: a native path"); - return; - } - node = rnd_conf_get_field(arg); - if (node == NULL) { - rnd_message(RND_MSG_ERROR, "No such path: '%s'", arg); - return; - } - gds_init(&s); - rnd_conf_print_native((rnd_conf_pfn)rnd_append_printf, &s, NULL, 0, node); - printf("%s='%s'\n", node->hash_path, s.array); - gds_uninit(&s); -} - -void cmd_load(char *arg, int is_text) -{ - char *fn; - rnd_conf_role_t role ; - - if (arg == NULL) { - help:; - rnd_message(RND_MSG_ERROR, "Need 2 args: role and %s", (is_text ? "lihata text" : "file name")); - return; - } - - if (*arg == '*') { - rnd_conf_load_all(NULL, NULL); - return; - } - - fn = strchr(arg, ' '); - if (fn == NULL) - goto help; - *fn = '\0'; - fn++; - while(isspace(*fn)) fn++; - - role = rnd_conf_role_parse(arg); - if (role == RND_CFR_invalid) { - rnd_message(RND_MSG_ERROR, "Invalid role: '%s'", arg); - return; - } - printf("Result: %d\n", rnd_conf_load_as(role, fn, is_text)); - rnd_conf_update(NULL, -1); -} - -rnd_conf_policy_t current_policy = RND_POL_OVERWRITE; -rnd_conf_role_t current_role = RND_CFR_DESIGN; - -void cmd_policy(char *arg) -{ - rnd_conf_policy_t np = rnd_conf_policy_parse(arg); - if (np == RND_POL_invalid) - rnd_message(RND_MSG_ERROR, "Invalid/unknown policy: '%s'", arg); - else - current_policy = np; -} - -void cmd_role(char *arg) -{ - rnd_conf_role_t nr = rnd_conf_role_parse(arg); - if (nr == RND_CFR_invalid) - rnd_message(RND_MSG_ERROR, "Invalid/unknown role: '%s'", arg); - else - current_role = nr; -} - -void cmd_chprio(char *arg) -{ - char *end; - int np = strtol(arg == NULL ? "" : arg, &end, 10); - lht_node_t *first; - - if ((*end != '\0') || (np < 0)) { - rnd_message(RND_MSG_ERROR, "Invalid integer prio: '%s'", arg); - return; - } - first = rnd_conf_lht_get_first(current_role, 0); - if (first != NULL) { - char tmp[128]; - char *end; - end = strchr(first->name, '-'); - if (end != NULL) - *end = '\0'; - sprintf(tmp, "%s-%d", first->name, np); - free(first->name); - first->name = rnd_strdup(tmp); - rnd_conf_update(NULL, -1); - } -} - -void cmd_chpolicy(char *arg) -{ - rnd_conf_policy_t np; - lht_node_t *first; - - if (arg == NULL) { - rnd_message(RND_MSG_ERROR, "need a policy", arg); - return; - } - np = rnd_conf_policy_parse(arg); - if (np == RND_POL_invalid) { - rnd_message(RND_MSG_ERROR, "Invalid integer policy: '%s'", arg); - return; - } - - first = rnd_conf_lht_get_first(current_role, 0); - if (first != NULL) { - char tmp[128]; - char *end; - end = strchr(first->name, '-'); - if (end != NULL) { - sprintf(tmp, "%s%s", arg, end); - free(first->name); - first->name = rnd_strdup(tmp); - } - else { - free(first->name); - first->name = rnd_strdup(arg); - } - rnd_conf_update(NULL, -1); - } -} - -void cmd_set(char *arg) -{ - char *path, *val; - int res; - - path = arg; - val = strpbrk(path, " \t="); - if (val == NULL) { - rnd_message(RND_MSG_ERROR, "set needs a value"); - return; - } - *val = '\0'; - val++; - while(isspace(*val) || (*val == '=')) val++; - - res = rnd_conf_set(current_role, path, -1, val, current_policy); - if (res != 0) - printf("set error: %d\n", res); -} - -void cmd_watch(char *arg, int add) -{ - rnd_conf_native_t *n = rnd_conf_get_field(arg); - if (n == NULL) { - rnd_message(RND_MSG_ERROR, "unknown path"); - return; - } - rnd_conf_hid_set_cb(n, hid_id, (add ? &watch_cbs : NULL)); -} - -void cmd_notify(char *arg) -{ - if (arg != NULL) { - if (strcmp(arg, "on") == 0) - global_notify = 1; - else if (strcmp(arg, "off") == 0) - global_notify = 0; - } - printf("Notify is %s\n", global_notify ? "on" : "off"); -} - -void cmd_echo(char *arg) -{ - if (arg != NULL) - printf("%s\n", arg); -} - -void cmd_reset(char *arg) -{ - if (arg == NULL) { - rnd_conf_reset(current_role, ""); - } - else if (*arg == '*') { - int n; - for(n = 0; n < RND_CFR_max_real; n++) - rnd_conf_reset(n, ""); - } - else { - rnd_conf_role_t role = rnd_conf_role_parse(arg); - if (role == RND_CFR_invalid) { - rnd_message(RND_MSG_ERROR, "Invalid role: '%s'", arg); - return; - } - rnd_conf_reset(role, ""); - } - rnd_conf_update(NULL, -1); -} - -extern void cmd_help(char *arg); - - -char line[8192]; - -/* returns 1 if there's more to read */ -int getline_cont(FILE *f) -{ - char *end = line + strlen(line) - 1; - int offs = 0, cont; - - if (feof(f)) - return 0; - - do { - int remain = sizeof(line)-offs; - assert(remain > 0); - cont = 0; - if (fgets(line+offs, remain, f)) { - char *start = line+offs; - int len = strlen(start); - lineno++; - end = start + len - 1; - while((end >= start) && ((*end == '\n') || (*end == '\r'))) { - *end = '\0'; - end--; - } - if ((end >= start) && (*end == '\\')) { - cont = 1; - *end = '\n'; - } - offs += len-1; - } - else { - if (offs == 0) - return 0; - } - } while(cont); - return 1; -} - -int main() -{ - rnd_app.package = "conftest"; - - hid_id = rnd_conf_hid_reg(hid_cookie, &global_cbs); - - rnd_file_loaded_init(); - rnd_conf_init(); - conf_core_init(); - rnd_hidlib_conf_init(); - rnd_conf_reset(RND_CFR_SYSTEM, "
"); - rnd_conf_reset(RND_CFR_USER, "
"); - - while(getline_cont(stdin)) { - char *arg, *cmd = line; - while(isspace(*cmd)) cmd++; - if ((*cmd == '#') || (*cmd == '\0')) - continue; - arg = strpbrk(cmd, " \t"); - if (arg != NULL) { - *arg = '\0'; - arg++; - while(isspace(*arg)) arg++; - } - - if (strcmp(cmd, "dump") == 0) - cmd_dump(arg); - else if (strcmp(cmd, "print") == 0) - cmd_print(arg); - else if (strcmp(cmd, "load") == 0) - cmd_load(arg, 0); - else if (strcmp(cmd, "paste") == 0) - cmd_load(arg, 1); - else if (strcmp(cmd, "reset") == 0) - cmd_reset(arg); - else if (strcmp(cmd, "set") == 0) - cmd_set(arg); - else if (strcmp(cmd, "policy") == 0) - cmd_policy(arg); - else if (strcmp(cmd, "chprio") == 0) - cmd_chprio(arg); - else if (strcmp(cmd, "chpolicy") == 0) - cmd_chpolicy(arg); - else if (strcmp(cmd, "role") == 0) - cmd_role(arg); - else if (strcmp(cmd, "watch") == 0) - cmd_watch(arg, 1); - else if (strcmp(cmd, "unwatch") == 0) - cmd_watch(arg, 0); - else if (strcmp(cmd, "notify") == 0) - cmd_notify(arg); - else if (strcmp(cmd, "echo") == 0) - cmd_echo(arg); - else if (strcmp(cmd, "help") == 0) - cmd_help(arg); - else - rnd_message(RND_MSG_ERROR, "unknown command '%s'", cmd); - } - - conf_core_uninit_pre(); - rnd_conf_hid_unreg(hid_cookie); - rnd_conf_uninit(); - return 0; -} Index: conf/help.c =================================================================== --- conf/help.c (revision 36751) +++ conf/help.c (nonexistent) @@ -1,90 +0,0 @@ -#include -#include -#include - -static const char *help[] = { - "dump", "native", - "Dump all settings as ended up in the native database after the last merge/udpate.", - - "dump", "lihata role", - "Dump all in-memory lihata settings of a given role. For roles, see: help roles", - - "load", "role filename", - "Load a lihata file as role", - - "load", "*", - "Load all roles from disk - the same way as it happens on a normal pcb-rnd startup.", - - "paste", "role lhttxt", - "Paste in-line lihata document lhttxt as role, like if it was loaded from a file", - - "policy", "pol", - "Change current set-policy to pol. This only affects whether a set command inserts, appends or overwrites list-type settings. For valid policies, see: help policies", - - "role", "rol", - "Change current set-policy to rol. This only affects the destination of subsequent set commands. For valid roles, see: help roles", - - "chprio", "prio", - "Change the priority of the first confroot of the current role's in-memory lihata document to prio and merge. Prio is an integer value.", - - "chpolicy", "pol", - "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 rnd_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", - - "unwatch", "path", - "Stop announcing changes of a given path. See also: help watch", - - "notify", "on", - "Turn on global notification on config changes.", - - "notify", "off", - "Turn off global notification on config changes.", - - "echo", "text...", - "Print multi-word text.", - - "reset", "role", - "Reset (make empty) the in-memory lihata document of role; see also: help roles", - - "reset", "*", - "Reset (make empty) all in-memory lihata documents", - -/* misc */ - "roles", NULL, - "Valid roles: system, defaultpcb, user, env, project, design, cli", - - "policies", NULL, - "Valid policies: prepend, append, overwrite", - - NULL, NULL, NULL -}; - -void cmd_help(char *arg) -{ - const char **s; - - printf("\n"); - - if (arg == NULL) { - const char *last = ""; - printf("Try help topic. Available topics:\n"); - for(s = help; s[2] != NULL; s+=3) { - if (strcmp(last, s[0]) != 0) - printf(" %s\n", s[0]); - last = s[0]; - } - return; - } - - for(s = help; s[2] != NULL; s+=3) { - if (strcmp(arg, s[0]) == 0) { - printf("%s %s\n", s[0], (s[1] == NULL ? "" : s[1])); - printf("%s\n\n", s[2]); - } - } -} Index: conf/Makefile =================================================================== --- conf/Makefile (revision 36751) +++ conf/Makefile (nonexistent) @@ -1,41 +0,0 @@ -ROOT=../.. -include $(ROOT)/Makefile.conf - -include $(LIBRND_MAK) - -CFLAGS = $(PCB_RND_C89FLAGS) -I../.. -I../../src_3rd -I../../src $(CFLAGS_LIBRND_FUNGW) $(CFLAGS_LIBRND) -LDLIBS = -lm $(LDFLAGS_LIBRND_FUNGW) $(LDFLAGS_LIBRND) - -LIB_HIDLIB=-lrnd-hid -lrnd-3rd - -LIB_PCBRND_OBJS=\ - ../../src/conf_core.o \ - ../../src/conf_internal.o - -DEPH = \ - $(LIBRND_INCDIR)/librnd/core/conf.h \ - $(LIBRND_INCDIR)/librnd/core/conf_hid.h \ - $(LIBRND_INCDIR)/librnd/core/compat_misc.h \ - ../../src/conf_core.h \ - ../../src_plugins/diag/diag_conf.h \ - -OBJS = conftest.o help.o - -all: conftest - -conftest: $(OBJS) $(LIB_PCBRND_OBJS) - $(CC) $(LDFLAGS) $(OBJS) $(LIB_PCBRND_OBJS) $(LIB_HIDLIB) $(LDLIBS) -o conftest - -conftest.o: conftest.c $(DEPH) - $(CC) $(CFLAGS) -c conftest.c -o conftest.o - -help.o: help.c - -$(LIB_HIDLIB): - cd ../../src && make - -test: - cd tests && $(MAKE) all - -clean: - -$(SCCBOX) rm -f conftest tests/*.out ../../src_plugins/diag/diag_conf.o $(OBJS) Index: Makefile =================================================================== --- Makefile (revision 36751) +++ Makefile (revision 36752) @@ -1,7 +1,6 @@ test: cd RTT && $(MAKE) all && $(MAKE) test cd pcbflags && $(MAKE) all && $(MAKE) test - cd conf && $(MAKE) all && $(MAKE) test cd strflags && $(MAKE) all && $(MAKE) test cd uniq_name && $(MAKE) all && $(MAKE) test cd propedit && $(MAKE) all && $(MAKE) test @@ -20,7 +19,6 @@ clean: cd RTT && $(MAKE) clean cd pcbflags && $(MAKE) clean - cd conf && $(MAKE) clean cd strflags && $(MAKE) clean cd uniq_name && $(MAKE) clean cd propedit && $(MAKE) clean