1184989Srafan/*
250276Speter * Copyright (c) 2002, 2003 Sendmail, Inc. and its suppliers.
3176187Srafan *	All rights reserved.
450276Speter *
550276Speter * By using this file, you agree to the terms and conditions set
650276Speter * forth in the LICENSE file which can be found at the top level of
750276Speter * the sendmail distribution.
850276Speter *
950276Speter *
1050276Speter *	$Id: bdb.h,v 1.4 2003/03/06 16:30:05 ca Exp $
1150276Speter */
1250276Speter
1350276Speter#ifndef	SM_BDB_H
1450276Speter#define SM_BDB_H
1550276Speter
1650276Speter#if NEWDB
1750276Speter# include <db.h>
1850276Speter# ifndef DB_VERSION_MAJOR
1950276Speter#  define DB_VERSION_MAJOR 1
2050276Speter# endif /* ! DB_VERSION_MAJOR */
2150276Speter
2250276Speter# if DB_VERSION_MAJOR >= 4 && DB_VERSION_MINOR >= 1
2350276Speter
2450276Speter#  define DBTXN	NULL ,
2550276Speter
2650276Speter/*
2750276Speter**  Always turn on DB_FCNTL_LOCKING for DB 4.1.x since its
2850276Speter**  "workaround" for accepting an empty (locked) file depends on
2950276Speter**  this flag. Notice: this requires 4.1.24 + patch (which should be
30176187Srafan**  part of 4.1.25).
3150276Speter*/
3250276Speter
3350276Speter#  define SM_DB_FLAG_ADD(flag)	(flag) |= DB_FCNTL_LOCKING
3450276Speter
3550276Speter# else /* DB_VERSION_MAJOR >= 4 && DB_VERSION_MINOR >= 1 */
3650276Speter
37176187Srafan#  define DBTXN
3850276Speter#  if !HASFLOCK && defined(DB_FCNTL_LOCKING)
39176187Srafan#   define SM_DB_FLAG_ADD(flag)	(flag) |= DB_FCNTL_LOCKING
40176187Srafan#  else /* !HASFLOCK && defined(DB_FCNTL_LOCKING) */
41176187Srafan#   define SM_DB_FLAG_ADD(flag)	((void) 0)
42176187Srafan#  endif /* !HASFLOCK && defined(DB_FCNTL_LOCKING) */
43176187Srafan
44176187Srafan# endif /* DB_VERSION_MAJOR >= 4 && DB_VERSION_MINOR >= 1 */
4550276Speter#endif /* NEWDB */
4650276Speter
4750276Speter#endif /* ! SM_BDB_H */
4850276Speter