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

[patch] Use the appropriate naming convention for protected APIs

From: Daniel Rall <dlr_at_collab.net>
Date: 2006-09-25 22:59:46 CEST

On Thu, 21 Sep 2006, David James wrote:

> On 9/21/06, Daniel Rall <dlr@collab.net> wrote:
> >Okay, I'm committing a change which makes an APR_VERSION_AT_LEAST()
> >macro available.
> >
> >How about the svn_hash_clear() function I committed to
> >svn_hash.h/hash.c a couple days ago? It's basically just a wrapper
> >around or re-implementation of APR's apr_hash_clear() API (also found
> >in APR 1.3.0). Should I then do away with svn_hash_clear(), and
> >conditionally define apr_hash_clear() in svn_compat.h?
>
> That seems nice and consistent. In that case, it might make sense to
> rename 'svn_hash_clear' to 'svn__hash_clear', so as to make clear that
> it's a private function which shouldn't be called directly (except
> through the macro).

How's this? We might want to do the same to the
svn_atomic_init_once() API in svn_atomic.h...

[[[
Rename svn_hash_clear() to svn_hash__clear() to reflect that it's not
part of Subversion's public API.

* subversion/include/svn_hash.h
* subversion/libsvn_subr/hash.c
  (svn_hash__clear): Rename from svn_hash_clear().

* subversion/libsvn_client/repos_diff.c
  (close_directory): Update for new API name.
]]]

Index: subversion/include/svn_hash.h
===================================================================
--- subversion/include/svn_hash.h (revision 21640)
+++ subversion/include/svn_hash.h (working copy)
@@ -200,7 +200,7 @@
  *
  * @since New in 1.5.
  */
-svn_error_t *svn_hash_clear(apr_hash_t *hash);
+svn_error_t *svn_hash__clear(apr_hash_t *hash);
 
 /** @} */
 
Index: subversion/libsvn_subr/hash.c
===================================================================
--- subversion/libsvn_subr/hash.c (revision 21640)
+++ subversion/libsvn_subr/hash.c (working copy)
@@ -436,7 +436,7 @@
 /*** Misc. hash APIs ***/
 
 svn_error_t *
-svn_hash_clear(apr_hash_t *hash)
+svn_hash__clear(apr_hash_t *hash)
 {
 #if APR_VERSION_AT_LEAST(1, 3, 0)
   apr_hash_clear(hash);
Index: subversion/libsvn_client/repos_diff.c
===================================================================
--- subversion/libsvn_client/repos_diff.c (revision 21640)
+++ subversion/libsvn_client/repos_diff.c (working copy)
@@ -794,7 +794,7 @@
   svn_error_t *err;
 
   if (eb->dry_run)
- svn_hash_clear(svn_client__dry_run_deletions(eb->diff_cmd_baton));
+ svn_hash__clear(svn_client__dry_run_deletions(eb->diff_cmd_baton));
 
   if (b->propchanges->nelts > 0)
     {

  • application/pgp-signature attachment: stored
Received on Mon Sep 25 23:01:04 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.