-# define EXIM_DBGET(db, key, data) \
- ((db)->get(db, NULL, &key, &data, 0) == 0)
-
-/* EXIM_DBPUT - returns nothing useful, assumes replace mode */
-# define EXIM_DBPUT(db, key, data) \
- (db)->put(db, NULL, &key, &data, 0)
-
-/* EXIM_DBPUTB - non-overwriting for use by dbmbuild */
-# define EXIM_DBPUTB(db, key, data) \
- (db)->put(db, NULL, &key, &data, DB_NOOVERWRITE)
-
-/* Return values from EXIM_DBPUTB */
-
-# define EXIM_DBPUTB_OK 0
-# define EXIM_DBPUTB_DUP DB_KEYEXIST
-
-/* EXIM_DBDEL */
-# define EXIM_DBDEL(db, key) (db)->del(db, NULL, &key, 0)
-
-/* EXIM_DBCREATE_CURSOR - initialize for scanning operation */
-
-# define EXIM_DBCREATE_CURSOR(db, cursor) \
- (db)->cursor(db, NULL, cursor, 0)
-
-/* EXIM_DBSCAN - returns TRUE if data is returned, FALSE at end */
-# define EXIM_DBSCAN(db, key, data, first, cursor) \
- ((cursor)->c_get(cursor, &key, &data, \
- (first? DB_FIRST : DB_NEXT)) == 0)
-
-/* EXIM_DBDELETE_CURSOR - terminate scanning operation */
-# define EXIM_DBDELETE_CURSOR(cursor) \
- (cursor)->c_close(cursor)
-
-/* EXIM_DBCLOSE */
-# define EXIM_DBCLOSE__(db) (db)->close(db, 0)
-
-/* Datum access types - these are intended to be assignable. */
-
-# define EXIM_DATUM_SIZE(datum) (datum).size
-# define EXIM_DATUM_DATA(datum) (datum).data
-
-/* The whole datum structure contains other fields that must be cleared
-before use, but we don't have to free anything after reading data. */
-
-# define EXIM_DATUM_INIT(datum) memset(&datum, 0, sizeof(datum))
-# define EXIM_DATUM_FREE(datum)
-
-#endif
-
-
-#else /* DB_VERSION_MAJOR >= 3 */
-
-/******************* Berkeley db 2.x native definitions ********************/
-
-/* Basic DB type */
-#define EXIM_DB DB
-
-/* Cursor type, for scanning */
-#define EXIM_CURSOR DBC
-
-/* The datum type used for queries */
-#define EXIM_DATUM DBT
-
-/* Some text for messages */
-#define EXIM_DBTYPE "db (v2)"
-
-/* Access functions */
-
-/* EXIM_DBOPEN - sets *dbpp to point to an EXIM_DB, NULL if failed */
-#define EXIM_DBOPEN__(name, dirname, flags, mode, dbpp) \
- if ((errno = db_open(CS name, DB_HASH, \
- ((flags) == O_RDONLY)? DB_RDONLY : DB_CREATE, \
- mode, NULL, NULL, dbpp)) != 0) *(dbpp) = NULL
-
-/* EXIM_DBGET - returns TRUE if successful, FALSE otherwise */
-#define EXIM_DBGET(db, key, data) \