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

Re: request for comments from developers about issues 1004 and 901

From: D.J. Heap <djheap_at_dhiprovo.com>
Date: 2003-08-12 21:55:56 CEST

SteveKing wrote:
> ----- Original Message -----
> From: "D.J. Heap" <djheap@dhiprovo.com>
>
>>A while ago I actually went through and changed the notification
>>mechanism to use a struct (the mails are on the list somewhere with
>>discussion from Philip) -- it really isn't very hard and is not called
>>from that many places (a dozenish, IIRC). Adding the 'union of structs'
>>concept would be more work, but not that much. I still plan on doing
>>that when I get some free time, but I'm not sure when that will be, and
>>it wasn't pressing since it wasn't really a problem -- just an api
>>convenience at the time.
>
>
> I still don't know how such a union of structs should look like.
> Right now the callback function takes 8 parameters. Would that
> be changed to one parameter being the union?
> And then that union would contain all those parameters and some
> more for the progress information in the struct?
>
> Stefan
>

There would be only one parameter that is a struct containing a notify
type indicator (and the baton, I would think, and perhaps other stuff
that is common to all notifications if there is any) and then a union of
different structs. Based on the notify type indicator you would know
which unioned struct to fill in/use for the info about that action.

The one parameter to the notify callback would be a struct like
(pseudo-code):

typedef struct svn_wc_notify_info_t
{
   void *baton;
   svn_wc_notify_action_t action;
   union
   {
     svn_wc_notify_notify_info_t notify_info;
     svn_wc_notify_update_info_t update_info;
     svn_wc_notify_commit_info_t commit_info;
   };
} svn_wc_notify_info_t;

The union structs would be just normal structs containing members
relevant to their notification action.

So clients would see the main struct in the callback, and then check the
action type to see which struct to use for the more specific info about
the action. At least, I believe this is the general idea...Philip?

DJ

**********************************************************************
This email and any files transmitted with it are confidential
and intended solely for the use of the individual or entity to
whom they are addressed. If you have received this email
in error please notify the system manager.

This footnote also confirms that this email message has been
swept by MIMEsweeper for the presence of computer viruses.

www.mimesweeper.com
**********************************************************************

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Tue Aug 12 21:56:52 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.