X-Git-Url: https://git.exim.org/exim.git/blobdiff_plain/d447dbd160a0fb503ed1e763f3f23d28744b6ddd..1ddb1855402d48ad735e46abaf0d662e45600ecd:/src/src/lookups/lmdb.c diff --git a/src/src/lookups/lmdb.c b/src/src/lookups/lmdb.c index 712261a41..a885badf1 100644 --- a/src/src/lookups/lmdb.c +++ b/src/src/lookups/lmdb.c @@ -2,12 +2,13 @@ * Exim - an Internet mail transport agent * *************************************************/ -/* Copyright (c) University of Cambridge 2016 - 2018*/ +/* Copyright (c) University of Cambridge 2016 - 2018 */ +/* Copyright (c) The Exim Maintainers 2020 - 2021 */ /* See the file NOTICE for conditions of use and distribution. */ #include "../exim.h" -#ifdef EXPERIMENTAL_LMDB +#ifdef LOOKUP_LMDB #include @@ -76,7 +77,7 @@ bad: static int lmdb_find(void * handle, const uschar * filename, const uschar * keystring, int length, uschar ** result, uschar ** errmsg, - uint * do_cache) + uint * do_cache, const uschar * opts) { int ret; MDB_val dbkey, data; @@ -128,26 +129,28 @@ mdb_env_close(db_env); #include "../version.h" -void -lmdb_version_report(FILE * f) +gstring * +lmdb_version_report(BOOL is_stdout) { -fprintf(f, "Library version: LMDB: Compile: %d.%d.%d\n", - MDB_VERSION_MAJOR, MDB_VERSION_MINOR, MDB_VERSION_PATCH); +gstring * g = string_fmt_append(g, + "Library version: LMDB: Compile: %d.%d.%d\n", + MDB_VERSION_MAJOR, MDB_VERSION_MINOR, MDB_VERSION_PATCH); #ifdef DYNLOOKUP -fprintf(f, " Exim version %s\n", EXIM_VERSION_STR); +g = string_fmt_append(g, " Exim version %s\n", EXIM_VERSION_STR); #endif +return g; } static lookup_info lmdb_lookup_info = { - US"lmdb", /* lookup name */ - lookup_absfile, /* query-style lookup */ - lmdb_open, /* open function */ - NULL, /* no check function */ - lmdb_find, /* find function */ - lmdb_close, /* close function */ - NULL, /* tidy function */ - NULL, /* quoting function */ - lmdb_version_report /* version reporting */ + .name = US"lmdb", /* lookup name */ + .type = lookup_absfile, /* query-style lookup */ + .open = lmdb_open, /* open function */ + .check = NULL, /* no check function */ + .find = lmdb_find, /* find function */ + .close = lmdb_close, /* close function */ + .tidy = NULL, /* tidy function */ + .quote = NULL, /* quoting function */ + .version_report = lmdb_version_report /* version reporting */ }; #ifdef DYNLOOKUP @@ -157,4 +160,4 @@ static lookup_info lmdb_lookup_info = { static lookup_info *_lookup_list[] = { &lmdb_lookup_info }; lookup_module_info lmdb_lookup_module_info = { LOOKUP_MODULE_INFO_MAGIC, _lookup_list, 1 }; -#endif /* EXPERIMENTAL_LMDB */ +#endif /* LOOKUP_LMDB */