/*
- * $Id: cnid_close.c,v 1.12.2.4 2002-02-09 20:29:02 jmarcus Exp $
+ * $Id: cnid_close.c,v 1.12.2.5 2002-06-17 21:09:01 jmarcus Exp $
*/
#ifdef HAVE_CONFIG_H
/* Checkpoint the databases until we can checkpoint no
* more. */
+#if DB_VERSION_MAJOR >= 4
+ rc = db->dbenv->txn_checkpoint(db->dbenv, 0, 0, 0);
+#else
rc = txn_checkpoint(db->dbenv, 0, 0, 0);
+#endif
while (rc == DB_INCOMPLETE) {
+#if DB_VERSION_MAJOR >= 4
+ rc = db->dbenv->txn_checkpoint(db->dbenv, 0, 0, 0);
+#else
rc = txn_checkpoint(db->dbenv, 0, 0, 0);
+#endif
}
-#if DB_VERSION_MINOR > 2
+#if DB_VERSION_MAJOR >= 4
+ if ((rc = db->dbenv->log_archive(db->dbenv, &list, DB_ARCH_ABS)) != 0) {
+#elif DB_VERSION_MINOR > 2
if ((rc = log_archive(db->dbenv, &list, DB_ARCH_ABS)) != 0) {
#else /* DB_VERSION_MINOR < 2 */
if ((rc = log_archive(db->dbenv, &list, DB_ARCH_ABS, NULL)) != 0) {
/*
- * $Id: cnid_lookup.c,v 1.9.2.4 2002-02-09 20:29:02 jmarcus Exp $
+ * $Id: cnid_lookup.c,v 1.9.2.5 2002-06-17 21:09:01 jmarcus Exp $
*/
#ifdef HAVE_CONFIG_H
#ifdef DEBUG
syslog(LOG_INFO, "cnid_lookup: Running database checkpoint");
#endif
+#if DB_VERSION_MAJOR >= 4
+ switch (rc = db->dbenv->txn_checkpoint(db->dbenv, LOGFILEMAX, CHECKTIMEMAX, 0)) {
+#else
switch (rc = txn_checkpoint(db->dbenv, LOGFILEMAX, CHECKTIMEMAX, 0)) {
+#endif
case 0:
case DB_INCOMPLETE:
break;
/*
- * $Id: cnid_open.c,v 1.19.2.5 2002-06-17 20:32:29 jmarcus Exp $
+ * $Id: cnid_open.c,v 1.19.2.6 2002-06-17 21:09:01 jmarcus Exp $
*
* Copyright (c) 1999. Adrian Sun (asun@zoology.washington.edu)
* All Rights Reserved. See COPYRIGHT.
#define DBVERSION1 0x00000001U
#define DBVERSION DBVERSION1
-#if DB_VERSION_MINOR > 1
+#if DB_VERSION_MAJOR >= 4 || (DB_VERSION_MAJOR == 4 && DB_VERSION_MINOR > 1)
#define DBOPTIONS (DB_CREATE | DB_INIT_MPOOL | DB_INIT_LOCK | \
DB_INIT_LOG | DB_INIT_TXN)
#else /* DB_VERSION_MINOR < 1 */
/* sort did's and then names. this is for unix paths.
* i.e., did/unixname lookups. */
-#if DB_VERSION_MINOR > 1
+#if DB_VERSION_MAJOR >= 4 || (DB_VERSION_MAJOR == 4 && DB_VERSION_MINOR > 1)
static int compare_unix(DB *db, const DBT *a, const DBT *b)
#else /* DB_VERSION_MINOR < 1 */
static int compare_unix(const DBT *a, const DBT *b)
* did/macname, and did/shortname. i think did/longname needs a
* unicode table to work. also, we can't use strdiacasecmp as that
* returns a match if a < b. */
-#if DB_VERSION_MINOR > 1
+#if DB_VERSION_MAJOR >= 4 || (DB_VERSION_MAJOR == 4 && DB_VERSION_MINOR > 1)
static int compare_mac(DB *db, const DBT *a, const DBT *b)
#else /* DB_VERSION_MINOR < 1 */
static int compare_mac(const DBT *a, const DBT *b)
/* for unicode names -- right now it's the same as compare_mac. */
-#if DB_VERSION_MINOR > 1
+#if DB_VERSION_MAJOR >= 4 || (DB_VERSION_MAJOR == 4 && DB_VERSION_MINOR > 1)
static int compare_unicode(DB *db, const DBT *a, const DBT *b)
#else /* DB_VERSION_MINOR < 1 */
static int compare_unicode(const DBT *a, const DBT *b)
#endif /* DB_VERSION_MINOR */
{
-#if DB_VERSION_MINOR > 1
+#if DB_VERSION_MAJOR >= 4 || (DB_VERSION_MAJOR == 4 && DB_VERSION_MINOR > 1)
return compare_mac(db,a,b);
#else /* DB_VERSION_MINOR < 1 */
return compare_mac(a,b);
goto fail_lock;
}
-#if DB_VERSION_MINOR > 1
+#if DB_VERSION_MAJOR >= 4 || (DB_VERSION_MAJOR == 4 && DB_VERSION_MINOR > 1)
#if 0
/* Take care of setting the DB_TXN_NOSYNC flag in db3 > 3.1.x. */
if ((rc = db->dbenv->set_flags(db->dbenv, DB_TXN_NOSYNC, 1)) != 0) {