Index: trunk/scconfig/gen_conf.sh =================================================================== --- trunk/scconfig/gen_conf.sh (revision 2117) +++ trunk/scconfig/gen_conf.sh (revision 2118) @@ -2,12 +2,31 @@ # TODO: rewrite this in C for better portability -awk ' +awk -v "docdir=$1" ' BEGIN { level = -1 q = "\"" cm = "," } + + function doc_head(fn, path) + { + if (fn in DOCS) + return + DOCS[fn]++ + print "" > fn + print "

pcb-rnd conf tree

" > fn + print "

subtree: " path "

" > fn + print "" > fn + print "
node name type flags description" > fn + + } + + function doc_foot(fn) + { + print "
" > fn + } + /[{]/ { level++ } /struct.*/ { @@ -71,7 +90,16 @@ path_tmp=path sub("^/", "", path_tmp) printf("conf_reg(%-36s %s %-16s %-25s %-25s %s, %s)\n", id cm, (array ? "array, " : "scalar,"), type cm, q path_tmp q cm, q name q cm, q desc q, flags) - + if (docdir != "") { + path_tmp2 = path_tmp + gsub("/", "_", path_tmp2) + fn = docdir "/" path_tmp2 ".html" + doc_head(fn, path_tmp) + type2 = tolower(type) + sub("^cfn_", "", type2) + + print "", name, "", type2, "", flags, "", desc > fn + } } /[}]/ { @@ -83,5 +111,7 @@ END { if (level != -1) print "Error: unbalanced braces" > "/dev/stderr" + for(fn in DOCS) + doc_foot(fn) } ' \ No newline at end of file Index: trunk/src/Makefile.in =================================================================== --- trunk/src/Makefile.in (revision 2117) +++ trunk/src/Makefile.in (revision 2118) @@ -239,7 +239,7 @@ ../scconfig/gen_core_lists.sh @/local/pcb/ACTION_REG_SRC@ > generated_lists.h conf_core_fields.h: conf_core.h - ../scconfig/gen_conf.sh < conf_core.h > conf_core_fields.h + ../scconfig/gen_conf.sh ../doc-rnd/conf/tree < conf_core.h > conf_core_fields.h conf_internal.c: pcb-conf.lht $(CQUOTE) -n conf_internal < pcb-conf.lht > conf_internal.c Index: trunk/src/conf.c =================================================================== --- trunk/src/conf.c (revision 2117) +++ trunk/src/conf.c (revision 2118) @@ -370,6 +370,8 @@ if ((pol == POL_DISABLE) || (pol == POL_invalid)) return 0; +#warning TODO: revise if it does what the doc says; do auto tests! + for(s = src_lst->data.list.first, idx = 0; s != NULL; s = s->next, idx++) { if (s->type == LHT_TEXT) { @@ -426,6 +428,7 @@ conflist_remove(i); } +#warning TODO: revise if it does what the doc says; do auto tests! for(s = src_lst->data.list.first; s != NULL; s = s->next) { if (s->type == LHT_TEXT) { i = calloc(sizeof(conf_listitem_t), 1);