Author: rinrab
Date: Wed Sep 25 15:32:03 2024
New Revision: 1920913

URL: http://svn.apache.org/viewvc?rev=1920913&view=rev
Log:
On the 'windows-shared-ra-modules' branch:

Rework compat init function implementations of RA modules and their wrappers
in libsvn_ra.

Before we had:

- svn_ra_*_init declarations in svn_ra.h.
- svn_ra_*_init implementations in each RA module.
- svn_ra_*__deprecated_init wrappers in libsvn_ra.

After the commit we are going to have:

- svn_ra.h hasn't changed and svn_ra_*_init are still declared there due
  to compatibility reasons.
- Each RA module will implement and export svn_ra_*__deprecated_init instead
  of svn_ra_*_init.
- libsvn_ra implements svn_ra_*_init wrapper over svn_ra_*__deprecated_init.

* subversion/libsvn_ra/deprecated.c
  (svn_ra_local__deprecated_init,
   svn_ra_svn__deprecated_init,
   svn_ra_serf__deprecated_init): Remove implementations. We now implement
   them in each RA module instead of svn_ra_foo_init.
  (includes): Do not include deprecated.h, since it got removed.

* subversion/libsvn_ra/deprecated.h: Remove header file. The functions are now
  declared in ra_init.h headers of each RA module.

* subversion/libsvn_ra/ra_loader.c
  (svn_ra_svn_init,
   svn_ra_local_init,
   svn_ra_serf_init): Implemented these functions always, even if linking
   against the modules or not. If the modules are linked, these functions
   just wraps svn_ra_foo__deprecated_init, while if the don's, it will
   return SVN_ERR_RA_NOT_IMPLEMENTED error.
  (includes): Do not include deprecated.h, since it got removed.

* subversion/libsvn_ra_local/ra_init.h
  (svn_ra_local__deprecated_init): Declare function.
* subversion/libsvn_ra_serf/ra_init.h
  (svn_ra_serf__deprecated_init): Declare function.
* subversion/libsvn_ra_svn/ra_init.h
  (svn_ra_svn__deprecated_init): Declare function.

* subversion/libsvn_ra_local/ra_plugin.c
  (COMPAT_INITFUNC): Change from svn_ra_local_init to 
svn_ra_local__deprecated_init.
* subversion/libsvn_ra_serf/serf.c
  (COMPAT_INITFUNC): Change from svn_ra_serf_init to 
svn_ra_serf__deprecated_init.
* subversion/libsvn_ra_svn/client.c
  (COMPAT_INITFUNC): Change from svn_ra_svn_init to svn_ra_svn__deprecated_init.

Removed:
    
subversion/branches/windows-shared-ra-modules/subversion/libsvn_ra/deprecated.h
Modified:
    
subversion/branches/windows-shared-ra-modules/subversion/libsvn_ra/deprecated.c
    
subversion/branches/windows-shared-ra-modules/subversion/libsvn_ra/ra_loader.c
    
subversion/branches/windows-shared-ra-modules/subversion/libsvn_ra_local/ra_init.h
    
subversion/branches/windows-shared-ra-modules/subversion/libsvn_ra_local/ra_plugin.c
    
subversion/branches/windows-shared-ra-modules/subversion/libsvn_ra_serf/ra_init.h
    
subversion/branches/windows-shared-ra-modules/subversion/libsvn_ra_serf/serf.c
    
subversion/branches/windows-shared-ra-modules/subversion/libsvn_ra_svn/client.c
    
subversion/branches/windows-shared-ra-modules/subversion/libsvn_ra_svn/ra_init.h

Modified: 
subversion/branches/windows-shared-ra-modules/subversion/libsvn_ra/deprecated.c
URL: 
http://svn.apache.org/viewvc/subversion/branches/windows-shared-ra-modules/subversion/libsvn_ra/deprecated.c?rev=1920913&r1=1920912&r2=1920913&view=diff
==============================================================================
--- 
subversion/branches/windows-shared-ra-modules/subversion/libsvn_ra/deprecated.c 
(original)
+++ 
subversion/branches/windows-shared-ra-modules/subversion/libsvn_ra/deprecated.c 
Wed Sep 25 15:32:03 2024
@@ -34,7 +34,6 @@
 #include "svn_pools.h"
 
 #include "ra_loader.h"
-#include "deprecated.h"
 
 #include "svn_private_config.h"
 
@@ -496,27 +495,3 @@ svn_error_t *svn_ra_get_dir(svn_ra_sessi
   return session->vtable->get_dir(session, dirents, fetched_rev, props,
                                   path, revision, SVN_DIRENT_ALL, pool);
 }
-
-svn_error_t *
-svn_ra_local__deprecated_init(int abi_version,
-                              apr_pool_t *pool,
-                              apr_hash_t *hash)
-{
-  return svn_error_trace(svn_ra_local_init(abi_version, pool, hash));
-}
-
-svn_error_t *
-svn_ra_svn__deprecated_init(int abi_version,
-                            apr_pool_t *pool,
-                            apr_hash_t *hash)
-{
-  return svn_error_trace(svn_ra_svn_init(abi_version, pool, hash));
-}
-
-svn_error_t *
-svn_ra_serf__deprecated_init(int abi_version,
-                             apr_pool_t *pool,
-                             apr_hash_t *hash)
-{
-  return svn_error_trace(svn_ra_serf_init(abi_version, pool, hash));
-}

Modified: 
subversion/branches/windows-shared-ra-modules/subversion/libsvn_ra/ra_loader.c
URL: 
http://svn.apache.org/viewvc/subversion/branches/windows-shared-ra-modules/subversion/libsvn_ra/ra_loader.c?rev=1920913&r1=1920912&r2=1920913&view=diff
==============================================================================
--- 
subversion/branches/windows-shared-ra-modules/subversion/libsvn_ra/ra_loader.c 
(original)
+++ 
subversion/branches/windows-shared-ra-modules/subversion/libsvn_ra/ra_loader.c 
Wed Sep 25 15:32:03 2024
@@ -50,7 +50,6 @@
 
 #include "svn_config.h"
 #include "ra_loader.h"
-#include "deprecated.h"
 
 #include "private/svn_auth_private.h"
 #include "private/svn_ra_private.h"
@@ -1586,32 +1585,41 @@ svn_ra_dav_init(int abi_version,
 }
 #endif /* ! SVN_LIBSVN_RA_LINKS_RA_NEON */
 
-#ifndef SVN_LIBSVN_RA_LINKS_RA_SVN
 svn_error_t *
 svn_ra_svn_init(int abi_version,
                 apr_pool_t *pool,
                 apr_hash_t *hash)
 {
+#ifdef SVN_LIBSVN_RA_LINKS_RA_SVN
+  return svn_error_trace(
+    svn_ra_svn__deprecated_init(abi_version, pool, hash));
+#else
   return svn_error_create(SVN_ERR_RA_NOT_IMPLEMENTED, NULL, NULL);
-}
 #endif /* ! SVN_LIBSVN_RA_LINKS_RA_SVN */
+}
 
-#ifndef SVN_LIBSVN_RA_LINKS_RA_LOCAL
 svn_error_t *
 svn_ra_local_init(int abi_version,
                   apr_pool_t *pool,
                   apr_hash_t *hash)
 {
+#ifdef SVN_LIBSVN_RA_LINKS_RA_LOCAL
+  return svn_error_trace(
+    svn_ra_local__deprecated_init(abi_version, pool, hash));
+#else
   return svn_error_create(SVN_ERR_RA_NOT_IMPLEMENTED, NULL, NULL);
-}
 #endif /* ! SVN_LIBSVN_RA_LINKS_RA_LOCAL */
+}
 
-#ifndef SVN_LIBSVN_RA_LINKS_RA_SERF
 svn_error_t *
 svn_ra_serf_init(int abi_version,
                  apr_pool_t *pool,
                  apr_hash_t *hash)
 {
+#ifdef SVN_LIBSVN_RA_LINKS_RA_SERF
+  return svn_error_trace(
+    svn_ra_serf__deprecated_init(abi_version, pool, hash));
+#else
   return svn_error_create(SVN_ERR_RA_NOT_IMPLEMENTED, NULL, NULL);
-}
 #endif /* ! SVN_LIBSVN_RA_LINKS_RA_SERF */
+}

Modified: 
subversion/branches/windows-shared-ra-modules/subversion/libsvn_ra_local/ra_init.h
URL: 
http://svn.apache.org/viewvc/subversion/branches/windows-shared-ra-modules/subversion/libsvn_ra_local/ra_init.h?rev=1920913&r1=1920912&r2=1920913&view=diff
==============================================================================
--- 
subversion/branches/windows-shared-ra-modules/subversion/libsvn_ra_local/ra_init.h
 (original)
+++ 
subversion/branches/windows-shared-ra-modules/subversion/libsvn_ra_local/ra_init.h
 Wed Sep 25 15:32:03 2024
@@ -30,4 +30,11 @@ svn_error_t *svn_ra_local__init(const sv
                                 const svn_ra__vtable_t **vtable,
                                 apr_pool_t *pool);
 
+/** Initialize libsvn_ra_local.
+ *
+ * @deprecated Provided for backward compatibility with the 1.1 API. */
+svn_error_t *svn_ra_local__deprecated_init(int abi_version,
+                                           apr_pool_t *pool,
+                                           apr_hash_t *hash);
+
 #endif

Modified: 
subversion/branches/windows-shared-ra-modules/subversion/libsvn_ra_local/ra_plugin.c
URL: 
http://svn.apache.org/viewvc/subversion/branches/windows-shared-ra-modules/subversion/libsvn_ra_local/ra_plugin.c?rev=1920913&r1=1920912&r2=1920913&view=diff
==============================================================================
--- 
subversion/branches/windows-shared-ra-modules/subversion/libsvn_ra_local/ra_plugin.c
 (original)
+++ 
subversion/branches/windows-shared-ra-modules/subversion/libsvn_ra_local/ra_plugin.c
 Wed Sep 25 15:32:03 2024
@@ -1998,5 +1998,5 @@ svn_ra_local__init(const svn_version_t *
 #define DESCRIPTION RA_LOCAL_DESCRIPTION
 #define VTBL ra_local_vtable
 #define INITFUNC svn_ra_local__init
-#define COMPAT_INITFUNC svn_ra_local_init
+#define COMPAT_INITFUNC svn_ra_local__deprecated_init
 #include "../libsvn_ra/wrapper_template.h"

Modified: 
subversion/branches/windows-shared-ra-modules/subversion/libsvn_ra_serf/ra_init.h
URL: 
http://svn.apache.org/viewvc/subversion/branches/windows-shared-ra-modules/subversion/libsvn_ra_serf/ra_init.h?rev=1920913&r1=1920912&r2=1920913&view=diff
==============================================================================
--- 
subversion/branches/windows-shared-ra-modules/subversion/libsvn_ra_serf/ra_init.h
 (original)
+++ 
subversion/branches/windows-shared-ra-modules/subversion/libsvn_ra_serf/ra_init.h
 Wed Sep 25 15:32:03 2024
@@ -30,4 +30,9 @@ svn_error_t *svn_ra_serf__init(const svn
                                const svn_ra__vtable_t **vtable,
                                apr_pool_t *pool);
 
+/* Non-deprecated wrapper around svn_ra_serf_init. */
+svn_error_t *svn_ra_serf__deprecated_init(int abi_version,
+                                          apr_pool_t *pool,
+                                          apr_hash_t *hash);
+
 #endif

Modified: 
subversion/branches/windows-shared-ra-modules/subversion/libsvn_ra_serf/serf.c
URL: 
http://svn.apache.org/viewvc/subversion/branches/windows-shared-ra-modules/subversion/libsvn_ra_serf/serf.c?rev=1920913&r1=1920912&r2=1920913&view=diff
==============================================================================
--- 
subversion/branches/windows-shared-ra-modules/subversion/libsvn_ra_serf/serf.c 
(original)
+++ 
subversion/branches/windows-shared-ra-modules/subversion/libsvn_ra_serf/serf.c 
Wed Sep 25 15:32:03 2024
@@ -1128,5 +1128,5 @@ svn_ra_serf__init(const svn_version_t *l
 #define DESCRIPTION RA_SERF_DESCRIPTION
 #define VTBL serf_vtable
 #define INITFUNC svn_ra_serf__init
-#define COMPAT_INITFUNC svn_ra_serf_init
+#define COMPAT_INITFUNC svn_ra_serf__deprecated_init
 #include "../libsvn_ra/wrapper_template.h"

Modified: 
subversion/branches/windows-shared-ra-modules/subversion/libsvn_ra_svn/client.c
URL: 
http://svn.apache.org/viewvc/subversion/branches/windows-shared-ra-modules/subversion/libsvn_ra_svn/client.c?rev=1920913&r1=1920912&r2=1920913&view=diff
==============================================================================
--- 
subversion/branches/windows-shared-ra-modules/subversion/libsvn_ra_svn/client.c 
(original)
+++ 
subversion/branches/windows-shared-ra-modules/subversion/libsvn_ra_svn/client.c 
Wed Sep 25 15:32:03 2024
@@ -3373,5 +3373,5 @@ svn_ra_svn__init(const svn_version_t *lo
 #define DESCRIPTION RA_SVN_DESCRIPTION
 #define VTBL ra_svn_vtable
 #define INITFUNC svn_ra_svn__init
-#define COMPAT_INITFUNC svn_ra_svn_init
+#define COMPAT_INITFUNC svn_ra_svn__deprecated_init
 #include "../libsvn_ra/wrapper_template.h"

Modified: 
subversion/branches/windows-shared-ra-modules/subversion/libsvn_ra_svn/ra_init.h
URL: 
http://svn.apache.org/viewvc/subversion/branches/windows-shared-ra-modules/subversion/libsvn_ra_svn/ra_init.h?rev=1920913&r1=1920912&r2=1920913&view=diff
==============================================================================
--- 
subversion/branches/windows-shared-ra-modules/subversion/libsvn_ra_svn/ra_init.h
 (original)
+++ 
subversion/branches/windows-shared-ra-modules/subversion/libsvn_ra_svn/ra_init.h
 Wed Sep 25 15:32:03 2024
@@ -30,4 +30,9 @@ svn_error_t *svn_ra_svn__init(const svn_
                               const svn_ra__vtable_t **vtable,
                               apr_pool_t *pool);
 
+/* Non-deprecated wrapper around svn_ra_svn_init. */
+svn_error_t *svn_ra_svn__deprecated_init(int abi_version,
+                                         apr_pool_t *pool,
+                                         apr_hash_t *hash);
+
 #endif


Reply via email to