Testsuite: tidying
[exim.git] / src / src / hintsdb.h
index b8e6744d688afacc945217be793433dcf98c7a04..ed1b5566d5ad29d6414487fe8590796d2f68657a 100644 (file)
@@ -5,6 +5,7 @@
 /* Copyright (c) The Exim Maintainers 2020 - 2022 */
 /* Copyright (c) University of Cambridge 1995 - 2018 */
 /* See the file NOTICE for conditions of use and distribution. */
+/* SPDX-License-Identifier: GPL-2.0-or-later */
 
 /* This header file contains macro definitions so that a variety of DBM
 libraries can be used by Exim. Nigel Metheringham provided the original set for
@@ -23,6 +24,10 @@ utilities as well as the main Exim binary. */
 
 #if defined(USE_TDB)
 
+# if defined(USE_DB) || defined(USE_GDBM)
+#  error USE_TDB conflict with alternate definition
+# endif
+
 /* ************************* tdb interface ************************ */
 /*XXX https://manpages.org/tdb/3 mentions concurrent writes.
 Could we lose the file lock? */
@@ -156,6 +161,10 @@ d->dptr = NULL;
 
 #elif defined USE_DB
 
+# if defined(USE_TDB) || defined(USE_GDBM)
+#  error USE_DB conflict with alternate definition
+# endif
+
 # include <db.h>
 
 /* 1.x did no locking
@@ -481,6 +490,10 @@ exim_datum_free(EXIM_DATUM * d)
 #elif defined USE_GDBM
 /*XXX TODO: exim's locfile not needed */
 
+# if defined(USE_TDB) || defined(USE_DB)
+#  error USE_GDBM conflict with alternate definition
+# endif
+
 # include <gdbm.h>
 
 /* Basic DB type */
@@ -608,7 +621,7 @@ static inline void
 exim_datum_free(EXIM_DATUM * d)
 { free(d->dptr); }
 
-/* size limit */
+/* size limit. GDBM is int-max limited, but we want to be less silly */
 
 # define EXIM_DB_RLIMIT        150
 
@@ -620,7 +633,7 @@ exim_datum_free(EXIM_DATUM * d)
 
 
 /* If none of USE_DB, USG_GDBM, or USE_TDB are set, the default is the NDBM
-interface */
+interface (which seems to be a wrapper for GDBM) */
 
 
 /********************* ndbm interface definitions **********************/
@@ -744,7 +757,7 @@ exim_datum_free(EXIM_DATUM * d)
 
 # define EXIM_DB_RLIMIT        150
 
-#endif /* USE_GDBM */
+#endif /* !USE_GDBM */