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

Re: [PATCH] automatic properties

From: Martin Furter <mf_at_rola.ch>
Date: 2003-10-02 20:02:06 CEST

On Thu, 2 Oct 2003, Philip Martin wrote:

> Martin Furter <mf@rola.ch> writes:
>
> > {
> > const void *propname;
> > void *propvalue;
>
> apr_ssize_t klen;
>
> > svn_string_t propvaluestr;
> >
> > apr_hash_this (hi, &propname, NULL, &propvalue);
>
> apr_hash_this (hi, &propname, &klen, &propvalue);
>
> > propvaluestr.data = propvalue;
> > propvaluestr.len = strlen (propvaluestr.data);
>
> propvaluestr.len = klen;
>
> > SVN_ERR (editor->change_file_prop (file_baton, propname,
> > &propvaluestr, pool));
> > }
>
> Hmm, "klen" doesn't really fit with the other names you have chosen.

I need the length of the value, not the key, so my version should be
correct (except i completely misunderstood the hash API).

Julian Foad wrote:
> I'd like someone else to check this method of creating a string.

A few examples of existing code:

subversion/libsvn_fs/dag.c

  (txn_body_dag_init_fs):
    svn_string_t date;
    ...
    date.data = svn_time_to_cstring (apr_time_now(), trail->pool);
    date.len = strlen (date.data);
  (svn_fs__dag_commit_txn, txn_body_dag_init_fs):
    date.len = strlen (date.data);

subversion/libsvn_ra_dav/fetch.c

  (end_element):
    valstr.len = strlen(cdata);

subversion/libsvn_ra_dav/merge.c

  (bump_resource):
    vsn_url_str.len = strlen(vsn_url);

subversion/libsvn_ra_dav/props.c

  (end_element):
    in.len = strlen(cdata);

And there are more places like these.
(are there some spaces missing ? ;-)

Martin

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Thu Oct 2 20:07:34 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.