[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

[1165] Option value expansion implementation

From: Daniel Rall <dlr_at_finemaltcoding.com>
Date: 2003-03-08 19:51:21 CET

In libsvn_subr/config.c's make_string_from_option() function, to
implement expansion I need to know which section that the option which
we're making a string for is coming from.

[section]
X=foo
Y=%(X)s

When expanding the value of X for option Y, I need know which section
option Y comes from so that I can look their for option X. I see two
ways of implementing this:

1) Added a cfg_section_t * to the cfg_option_t structure (set in the
svn_config_set() function), so that an option knows which section it
comes from. This would require moving the block in svn_config_set()
which creates a section if one doesn't already exist to before the
instantiation of the option.

2) Leverage the last parameter of find_option() (a cfg_section_t **),
and expand the API of make_string_from_option() to take a
cfg_section_t * parameter. find_option() seems to always be called
before make_string_from_option().

Both are fairly easy to implement, but I'm not sure which would be
most appropriate and am hoping for some feedback.

-- 
Daniel Rall <dlr@finemaltcoding.com>
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Sat Mar 8 19:51:57 2003

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.