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

Re: CVS update: subversion/subversion/include svn_ra.h

From: Greg Stein <gstein_at_lyra.org>
Date: 2000-12-01 02:23:54 CET

On Thu, Nov 30, 2000 at 07:25:55PM -0000, sussman@tigris.org wrote:
>...
> +typedef struct svn_ra_plugin_t
> +{
> + svn_string_t *name; /* The name of the ra library,
> + e.g. "ra_dav" or "ra_local" */
> +
> + svn_string_t *description; /* Short documentation string */

These should be "const char *". Nobody is going to do any string
manipulation with them (and if they do, they can wrap them into a string at
that point). By using the simpler type, we can also create a static
structure like so:

static const svn_ra_plugin_t plugin = {
    "ra_greg",
    "some description goes here",
    my_ra_open,
    ...
};

> + apr_dso_handle_t *my_dso; /* handle on the actual library loaded */

By putting this in here, we toss out the option of using "const" in the
above declaration.

Within libsvn_client, you can have a hash that maps NAME to { DSO,
PLUGIN-PTR }.

>...
> + /* TODO: the working copy needs to send a description of its
> + version numbers to the repository *before* receiving an update.
> + How will this work in terms of control-flow? */

Why can't the RA layer send a version number, fetch an update if necessary,
then move on to the next one? Why must it use two passes?

>...
> +typedef struct svn_ra_init_params
> +{
> + apr_pool_t *pool; /* where to allocate new plugin */
> + apr_array_header_t *client_plugins; /* client's private array of
> + plugins */

I think this would be a hash table.

>...
> + When called by libsvn_client, this routine must:
> +
> + * allocate a new ra_plugin object from params->pool

I believe it is possible to use a "static const" structure rather than an
allocation (and the resulting, add'l complexity).

>...
> +/* Greg, please update ra_dav to use the declarations above, not
> + below! I'm leaving these here so that we can still compile. */

I'll start tweaking ra_dav to this latest rev.

Cheers,
-g

-- 
Greg Stein, http://www.lyra.org/
Received on Sat Oct 21 14:36:15 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.