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

Re: [PATCH] Use stream translation API for check file modifications.

From: Peter Lundblad <peter_at_famlundblad.se>
Date: 2006-02-27 14:36:47 CET

[I seem to have accidentally taken this off-list. That's because I'm
still learning my new mail client. Sorry.]

Ivan Zhakov writes:
> > > Index: subversion/include/svn_io.h
> > > ===================================================================
> > > --- subversion/include/svn_io.h (revision 18619)
> > > +++ subversion/include/svn_io.h (working copy)
> > > @@ -689,6 +689,17 @@
> > > svn_error_t *svn_stream_copy(svn_stream_t *from, svn_stream_t *to,
> > > apr_pool_t *pool);
> > >
> > > +/** Set @a *same to non-zero if @a stream1 and @a stream2 have the same
> > > + * contents, else set it to zero. Use @a pool for temporary allocations.
> >
> > Use "TRUE" and "FALSE" instead of non-zero and zero.
> I have copied this docstring from svn_io_files_contents_same_p(). But
> anyway I change it to
> "TRUE" and "FALSE".
>
> >
> > > + *
> > > + * @since New in 1.4.
> > > + */
> > > +svn_error_t *
> > > +svn_stream_contents_same(svn_boolean_t *same,
> > > + svn_stream_t *stream1,
> > > + svn_stream_t *stream2,
> > > + apr_pool_t *pool);
> > > +
> >
> > We only have one user of this function, so why make it public? (See
> > below as well.)
> Several reasons:
> 1) I hate when source code mixed with general helpers, like
> svn_stream_contents_same.
> 2) We have stream object, we have utility function such as open,
> close, copy so why not extend it with compare?

I wouldn't call open and close utility functions:-) I think it is fine
to have utility functions public if they are used in several
libraries.

> 3) Minimize probability that somebody later create similar helper in
> his source file.
>
OTOH, we already have lots of public API functions; I still think this
could go public when necessary instead of now, but I can live with it.

Best,
//Peter

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Mon Feb 27 14:48:08 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.