apr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From wr...@apache.org
Subject svn commit: r719533 - in /apr/apr-util/trunk: dbm/apr_dbm.c dbm/apr_dbm_berkeleydb.c dbm/apr_dbm_gdbm.c dbm/apr_dbm_ndbm.c dbm/apr_dbm_sdbm.c include/private/apr_dbm_private.h
Date Fri, 21 Nov 2008 08:21:07 GMT
Author: wrowe
Date: Fri Nov 21 00:21:06 2008
New Revision: 719533

URL: http://svn.apache.org/viewvc?rev=719533&view=rev
Log:
Assorted corrections and bug fixes I had missed, as Unix
was picking up an odd path through the dbm source files.
Tests now pass (linux x86 for sdbm/gdbm/db4).

Modified:
    apr/apr-util/trunk/dbm/apr_dbm.c
    apr/apr-util/trunk/dbm/apr_dbm_berkeleydb.c
    apr/apr-util/trunk/dbm/apr_dbm_gdbm.c
    apr/apr-util/trunk/dbm/apr_dbm_ndbm.c
    apr/apr-util/trunk/dbm/apr_dbm_sdbm.c
    apr/apr-util/trunk/include/private/apr_dbm_private.h

Modified: apr/apr-util/trunk/dbm/apr_dbm.c
URL: http://svn.apache.org/viewvc/apr/apr-util/trunk/dbm/apr_dbm.c?rev=719533&r1=719532&r2=719533&view=diff
==============================================================================
--- apr/apr-util/trunk/dbm/apr_dbm.c (original)
+++ apr/apr-util/trunk/dbm/apr_dbm.c Fri Nov 21 00:21:06 2008
@@ -15,6 +15,8 @@
  */
 
 #include "apr.h"
+#include "apr_dso.h"
+#include "apr_hash.h"
 #include "apr_errno.h"
 #include "apr_pools.h"
 #include "apr_strings.h"
@@ -23,7 +25,10 @@
 #include "apr_want.h"
 #include "apr_general.h"
 
+#include "apu_config.h"
 #include "apu.h"
+#include "apu_internal.h"
+#include "apu_version.h"
 #include "apr_dbm_private.h"
 #include "apu_select_dbm.h"
 #include "apr_dbm.h"
@@ -55,7 +60,7 @@
 
 static apr_hash_t *drivers = NULL;
 
-static apr_status_t apr_dbd_term(void *ptr)
+static apr_status_t dbm_term(void *ptr)
 {
     /* set drivers to NULL so init can work again */
     drivers = NULL;
@@ -81,13 +86,13 @@
 #endif
     else if (*type && !strcasecmp(type + 1, "dbm")) {
 #if APU_HAVE_GDBM
-        if (*type == 'G' && *type == 'g') *vtable = &apr_dbm_type_gdbm;
+        if (*type == 'G' || *type == 'g') *vtable = &apr_dbm_type_gdbm;
 #endif
 #if APU_HAVE_NDBM
-        if (*type == 'N' && *type == 'n') *vtable = &apr_dbm_type_ndbm;
+        if (*type == 'N' || *type == 'n') *vtable = &apr_dbm_type_ndbm;
 #endif
 #if APU_HAVE_SDBM
-        if (*type == 'S' && *type == 's') *vtable = &apr_dbm_type_sdbm;
+        if (*type == 'S' || *type == 's') *vtable = &apr_dbm_type_sdbm;
 #endif
         /* avoid empty block */ ;
     }
@@ -106,34 +111,33 @@
     if (!strcasecmp(type, "default"))        type = DBM_NAME;
     else if (!strcasecmp(type, "db"))        type = "db";
     else if (*type && !strcasecmp(type + 1, "dbm")) {
-        if      (type == 'G' || type == 'g') type = "gdbm"; 
-        else if (type == 'N' || type == 'n') type = "ndbm"; 
-        else if (type == 'S' || type == 's') type = "sdbm"; 
+        if      (*type == 'G' || *type == 'g') type = "gdbm"; 
+        else if (*type == 'N' || *type == 'n') type = "ndbm"; 
+        else if (*type == 'S' || *type == 's') type = "sdbm"; 
     }
     else usertype = 1;
 
     if (!drivers)
     {
-        apr_pool_t *ppool = pool;
         apr_pool_t *parent;
 
         /* Top level pool scope, need process-scope lifetime */
-        for (parent = pool;  parent; parent = apr_pool_parent_get(ppool))
-             ppool = parent;
+        for (parent = pool;  parent; parent = apr_pool_parent_get(pool))
+             pool = parent;
 
         /* deprecate in 2.0 - permit implicit initialization */
-        apu_dso_init(ppool);
+        apu_dso_init(pool);
 
-        drivers = apr_hash_make(ppool);
+        drivers = apr_hash_make(pool);
         apr_hash_set(drivers, "sdbm", APR_HASH_KEY_STRING, &apr_dbm_type_sdbm);
 
-        apr_pool_cleanup_register(ppool, NULL, dbm_term,
+        apr_pool_cleanup_register(pool, NULL, dbm_term,
                                   apr_pool_cleanup_null);
     }
 
     rv = apu_dso_mutex_lock();
     if (rv) {
-        *vtable = NULL
+        *vtable = NULL;
         return rv;
     }
 
@@ -158,12 +162,13 @@
 #endif
     apr_snprintf(symname, sizeof(symname), "apr_dbm_type_%s", type);
 
-    rv = apu_dso_load(&symbol, modname, symname, pool);
-    if (rv != APR_SUCCESS || rv == APR_EINIT) { /* previously loaded?!? */
+    rv = apu_dso_load(NULL, &symbol, modname, symname, pool);
+    if (rv == APR_SUCCESS || rv == APR_EINIT) { /* previously loaded?!? */
         *vtable = symbol;
         if (usertype)
             type = apr_pstrdup(pool, type);
         apr_hash_set(drivers, type, APR_HASH_KEY_STRING, *vtable);
+        rv = APR_SUCCESS;
     }
     else
         *vtable = NULL;

Modified: apr/apr-util/trunk/dbm/apr_dbm_berkeleydb.c
URL: http://svn.apache.org/viewvc/apr/apr-util/trunk/dbm/apr_dbm_berkeleydb.c?rev=719533&r1=719532&r2=719533&view=diff
==============================================================================
--- apr/apr-util/trunk/dbm/apr_dbm_berkeleydb.c (original)
+++ apr/apr-util/trunk/dbm/apr_dbm_berkeleydb.c Fri Nov 21 00:21:06 2008
@@ -25,6 +25,7 @@
 #include <stdlib.h> /* for abort() */
 #endif
 
+#include "apu_config.h"
 #include "apu.h"
 
 #if APU_HAVE_DB 

Modified: apr/apr-util/trunk/dbm/apr_dbm_gdbm.c
URL: http://svn.apache.org/viewvc/apr/apr-util/trunk/dbm/apr_dbm_gdbm.c?rev=719533&r1=719532&r2=719533&view=diff
==============================================================================
--- apr/apr-util/trunk/dbm/apr_dbm_gdbm.c (original)
+++ apr/apr-util/trunk/dbm/apr_dbm_gdbm.c Fri Nov 21 00:21:06 2008
@@ -14,6 +14,7 @@
  * limitations under the License.
  */
 
+#include "apu_config.h"
 #include "apu.h"
 #include "apr_strings.h"
 

Modified: apr/apr-util/trunk/dbm/apr_dbm_ndbm.c
URL: http://svn.apache.org/viewvc/apr/apr-util/trunk/dbm/apr_dbm_ndbm.c?rev=719533&r1=719532&r2=719533&view=diff
==============================================================================
--- apr/apr-util/trunk/dbm/apr_dbm_ndbm.c (original)
+++ apr/apr-util/trunk/dbm/apr_dbm_ndbm.c Fri Nov 21 00:21:06 2008
@@ -20,6 +20,7 @@
 #include <stdlib.h>     /* for free() */
 #endif
 
+#include "apu_config.h"
 #include "apu.h"
 
 #if APU_HAVE_NDBM

Modified: apr/apr-util/trunk/dbm/apr_dbm_sdbm.c
URL: http://svn.apache.org/viewvc/apr/apr-util/trunk/dbm/apr_dbm_sdbm.c?rev=719533&r1=719532&r2=719533&view=diff
==============================================================================
--- apr/apr-util/trunk/dbm/apr_dbm_sdbm.c (original)
+++ apr/apr-util/trunk/dbm/apr_dbm_sdbm.c Fri Nov 21 00:21:06 2008
@@ -19,6 +19,7 @@
 #define APR_WANT_STRFUNC
 #include "apr_want.h"
 
+#include "apu_config.h"
 #include "apu.h"
 
 #if APU_HAVE_SDBM
@@ -206,7 +207,7 @@
     *used2 = apr_pstrcat(pool, pathname, APR_SDBM_PAGFEXT, NULL);
 }
 
-APU_DECLARE_DATA const apr_dbm_type_t apr_dbm_type_sdbm = {
+APU_MODULE_DECLARE_DATA const apr_dbm_type_t apr_dbm_type_sdbm = {
     "sdbm",
     vt_sdbm_open,
     vt_sdbm_close,

Modified: apr/apr-util/trunk/include/private/apr_dbm_private.h
URL: http://svn.apache.org/viewvc/apr/apr-util/trunk/include/private/apr_dbm_private.h?rev=719533&r1=719532&r2=719533&view=diff
==============================================================================
--- apr/apr-util/trunk/include/private/apr_dbm_private.h (original)
+++ apr/apr-util/trunk/include/private/apr_dbm_private.h Fri Nov 21 00:21:06 2008
@@ -108,13 +108,11 @@
 };
 
 
-/* Declare all of the builtin DBM providers */
-APU_DECLARE_DATA extern const apr_dbm_type_t apr_dbm_type_sdbm;
-#if !APU_DSO_BUILD
-APU_DECLARE_DATA extern const apr_dbm_type_t apr_dbm_type_gdbm;
-APU_DECLARE_DATA extern const apr_dbm_type_t apr_dbm_type_ndbm;
-APU_DECLARE_DATA extern const apr_dbm_type_t apr_dbm_type_db;
-#endif
+/* Declare all of the DBM provider tables */
+APU_MODULE_DECLARE_DATA extern const apr_dbm_type_t apr_dbm_type_sdbm;
+APU_MODULE_DECLARE_DATA extern const apr_dbm_type_t apr_dbm_type_gdbm;
+APU_MODULE_DECLARE_DATA extern const apr_dbm_type_t apr_dbm_type_ndbm;
+APU_MODULE_DECLARE_DATA extern const apr_dbm_type_t apr_dbm_type_db;
 
 #ifdef __cplusplus
 }



Mime
View raw message