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

Re: More documentation for svn_utf_cstring_from_utf8_ex() etc.

From: Julian Foad <julianfoad_at_btopenworld.com>
Date: 2006-03-22 23:36:05 CET

Julian Foad wrote:
> 2. What is the meaning and purpose of the "convset_key" parameter? I
> can see what's written; I don't understand what sort of value I have to
> pass and what function it performs.

Paul Burba wrote of the values, in a separate thread:
> My description of these is likely not clear enough. They are keys for
> caching xlate_handle_node_t structs for conversions between EBCDIC and
> UTF-8 and vice-versa when calling svn_utf_cstring_to_utf8_ex() and
> svn_utf_cstring_from_utf8_ex(), i.e. the convset_key argument to these
> functions.
[...]
> +/* Cache keys for the charset converters used by
> + * svn_utf_cstring_from_utf8_ex and svn_utf_cstring_to_utf8_ex respectively
> + * when performing conversions between UTF-8 and EBCDIC.
> + */
> +#define SVN_UTF_UTOE_XLATE_HANDLE "svn-utf-utoe-xlate-handle"
> +#define SVN_UTF_ETOU_XLATE_HANDLE "svn-utf-etou-xlate-handle"

When you say they are "keys for caching", does that mean that everything works
regardless of what values you pass for these keys, even if the values differ
between one call and the next, and the only ill-effect of not passing the same
value consistently is that the conversions are slower?

If so, then we could regard these as private to each library: we need not use
the same values throughout the application. I'm not saying we want to do that,
just trying to understand what's possible and suggesting that this _might_ be
better than making them public.

I can't help thinking that this parameter is redundant. Why can't the
"frompage" or "topage" parameter to svn_utf_cstring_*_utf8_ex() be used as the
cache key?

- Julian

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Wed Mar 22 23:36:32 2006

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.