X-Git-Url: https://git.exim.org/exim.git/blobdiff_plain/c988f1f4faa9f679f79beddf3c14676c5dcb8e28..a85c067ba6c6940512cf57ec213277a370d87e70:/src/src/dbfunctions.h diff --git a/src/src/dbfunctions.h b/src/src/dbfunctions.h index 74c7e6127..93e1d3405 100644 --- a/src/src/dbfunctions.h +++ b/src/src/dbfunctions.h @@ -1,30 +1,39 @@ -/* $Cambridge: exim/src/src/dbfunctions.h,v 1.2 2005/01/04 10:00:42 ph10 Exp $ */ - /************************************************* * Exim - an Internet mail transport agent * *************************************************/ -/* Copyright (c) University of Cambridge 1995 - 2005 */ +/* Copyright (c) The Exim Maintainers 2022 */ +/* Copyright (c) University of Cambridge 1995 - 2021 */ /* See the file NOTICE for conditions of use and distribution. */ +/* SPDX-License-Identifier: GPL-2.0-only */ +#ifndef DBFUNCTIONS_H +#define DBFUNCTIONS_H /* Functions for reading/writing exim database files */ void dbfn_close(open_db *); -int dbfn_delete(open_db *, uschar *); -open_db *dbfn_open(uschar *, int, open_db *, BOOL); -void *dbfn_read_with_length(open_db *, uschar *, int *); +int dbfn_delete(open_db *, const uschar *); +open_db *dbfn_open(uschar *, int, open_db *, BOOL, BOOL); +void *dbfn_read_with_length(open_db *, const uschar *, int *); +void *dbfn_read_enforce_length(open_db *, const uschar *, size_t); uschar *dbfn_scan(open_db *, BOOL, EXIM_CURSOR **); -int dbfn_write(open_db *, uschar *, void *, int); +int dbfn_write(open_db *, const uschar *, void *, int); /* Macro for the common call to read without wanting to know the length. */ #define dbfn_read(a, b) dbfn_read_with_length(a, b, NULL) -/* Berkeley DB uses a callback function to pass back error details. */ +/* Berkeley DB uses a callback function to pass back error details. Its API +changed at release 4.3. */ #if defined(USE_DB) && defined(DB_VERSION_STRING) +# if DB_VERSION_MAJOR > 4 || (DB_VERSION_MAJOR == 4 && DB_VERSION_MINOR >= 3) +void dbfn_bdb_error_callback(const DB_ENV *, const char *, const char *); +# else void dbfn_bdb_error_callback(const char *, char *); +# endif #endif +#endif /* End of dbfunctions.h */