Lookups: ret=key option
[exim.git] / src / src / dbfunctions.h
CommitLineData
059ec3d9
PH
1/*************************************************
2* Exim - an Internet mail transport agent *
3*************************************************/
4
3386088d 5/* Copyright (c) University of Cambridge 1995 - 2015 */
059ec3d9
PH
6/* See the file NOTICE for conditions of use and distribution. */
7
8
9/* Functions for reading/writing exim database files */
10
11void dbfn_close(open_db *);
55414b25 12int dbfn_delete(open_db *, const uschar *);
b10c87b3 13open_db *dbfn_open(uschar *, int, open_db *, BOOL, BOOL);
55414b25 14void *dbfn_read_with_length(open_db *, const uschar *, int *);
059ec3d9 15uschar *dbfn_scan(open_db *, BOOL, EXIM_CURSOR **);
55414b25 16int dbfn_write(open_db *, const uschar *, void *, int);
059ec3d9
PH
17
18/* Macro for the common call to read without wanting to know the length. */
19
20#define dbfn_read(a, b) dbfn_read_with_length(a, b, NULL)
21
1f922db1
PH
22/* Berkeley DB uses a callback function to pass back error details. Its API
23changed at release 4.3. */
059ec3d9
PH
24
25#if defined(USE_DB) && defined(DB_VERSION_STRING)
1f922db1
PH
26#if DB_VERSION_MAJOR > 4 || (DB_VERSION_MAJOR == 4 && DB_VERSION_MINOR >= 3)
27void dbfn_bdb_error_callback(const DB_ENV *, const char *, const char *);
28#else
059ec3d9
PH
29void dbfn_bdb_error_callback(const char *, char *);
30#endif
1f922db1 31#endif
059ec3d9
PH
32
33/* End of dbfunctions.h */