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