Config file parser for lists
Julien ÉLIE
julien at trigofacile.com
Sat Mar 28 13:45:11 UTC 2009
Hi Russ,
> It's not as clear as it should be, but in include/inn/confparse.h see:
>
> /* Free all space allocated by the tree rooted at config_group. One normally
> never wants to do this. WARNING: This includes the storage allocated for
> all strings returned by config_param_string and config_param_list for any
> configuration groups in this tree. */
> void config_free(struct config_group *);
OK, thanks!
It now works fine. Examples with:
extraoverview: [ one "two" "th\
ree" "f\"\\o\tu'\nr" ]
domain: "\"\n'news.trigofacile.com"
% ./innconfval | head -5
"
'news.trigofacile.com
true
[ one two three f"\o u'
r ]
% ./innconfval -p | head -5
$domain = '"
\'news.trigofacile.com';
$enableoverview = 'true';
@extraoverview = ( 'one', 'two', 'three', 'f"\\o u\'
r' );
% ./innconfval -s | head -5
DOMAIN='"
'\''news.trigofacile.com'; export DOMAIN;
ENABLEOVERVIEW=true; export ENABLEOVERVIEW;
EXTRAOVERVIEW=( 'one' 'two' 'three' 'f"\\o u'\''
r' ); export EXTRAOVERVIEW;
% ./innconfval -t | head -5
set inn_domain "\"
'news.trigofacile.com"
set inn_enableoverview "true"
set inn_extraoverview { "one" "two" "three" "f\"\\o u'
r" }
I fed that to perl, bash and tclsh and it seems good.
--
Julien ÉLIE
« Rubor, tumor, dolor, calor et functio laesa. »
More information about the inn-workers
mailing list