Index: trunk/src/conf.c =================================================================== --- trunk/src/conf.c (revision 3581) +++ trunk/src/conf.c (revision 3582) @@ -151,6 +151,27 @@ return CFR_invalid; } +const char *conf_role_name(conf_role_t r) +{ + switch(r) { + case CFR_INTERNAL: return "internal"; + case CFR_SYSTEM: return "system"; + case CFR_DEFAULTPCB: return "defaultpcb"; + case CFR_USER: return "user"; + case CFR_PROJECT: return "project"; + case CFR_DESIGN: return "design"; + case CFR_CLI: return "cli"; + case CFR_file: return "(file)"; + case CFR_binary: return "(binary)"; + + case CFR_max_alloc: + case CFR_max_real: + case CFR_invalid: return "(invalid role)"; + } + return "(unknown role)"; +} + + void extract_poliprio(lht_node_t *root, conf_policy_t *gpolicy, long *gprio) { long len = strlen(root->name), p = -1; Index: trunk/src/conf.h =================================================================== --- trunk/src/conf.h (revision 3581) +++ trunk/src/conf.h (revision 3582) @@ -204,6 +204,9 @@ /* convert a role text to role value - return CFR_invalid on error */ conf_role_t 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); + /* 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 create or remove nodes). This is useful when an io_ file format supports