-/* $Cambridge: exim/src/src/lookups/cdb.c,v 1.1 2004/10/07 13:10:01 ph10 Exp $ */
-
/*************************************************
* Exim - an Internet mail transport agent *
*************************************************/
#include "../exim.h"
#include "lf_functions.h"
-#include "cdb.h"
#ifdef HAVE_MMAP
# include <sys/mman.h>
return num;
}
-void *
+static void cdb_close(void *handle);
+
+static void *
cdb_open(uschar *filename,
uschar **errmsg)
{
if (statbuf.st_size < CDB_HASH_TABLE) {
int save_errno = errno;
*errmsg = string_open_failed(errno,
- "%s to short for cdb lookup",
+ "%s too short for cdb lookup",
filename);
errno = save_errno;
return NULL;
* Check entry point *
*************************************************/
-BOOL
+static BOOL
cdb_check(void *handle,
uschar *filename,
int modemask,
* Find entry point *
*************************************************/
-int
+static int
cdb_find(void *handle,
uschar *filename,
uschar *keystring,
/* See local README for interface description */
-void
+static void
cdb_close(void *handle)
{
struct cdb_state * cdbp = handle;
}
#endif /* HAVE_MMAP */
- close(cdbp->fileno);
+ (void)close(cdbp->fileno);
+}
+
+
+
+/*************************************************
+* Version reporting entry point *
+*************************************************/
+
+/* See local README for interface description. */
+
+#include "../version.h"
+
+void
+cdb_version_report(FILE *f)
+{
+#ifdef DYNLOOKUP
+fprintf(f, "Library version: CDB: Exim version %s\n", EXIM_VERSION_STR);
+#endif
}
+
+lookup_info cdb_lookup_info = {
+ US"cdb", /* lookup name */
+ lookup_absfile, /* uses absolute file name */
+ cdb_open, /* open function */
+ cdb_check, /* check function */
+ cdb_find, /* find function */
+ cdb_close, /* close function */
+ NULL, /* no tidy function */
+ NULL, /* no quoting function */
+ cdb_version_report /* version reporting */
+};
+
+#ifdef DYNLOOKUP
+#define cdb_lookup_module_info _lookup_module_info
+#endif
+
+static lookup_info *_lookup_list[] = { &cdb_lookup_info };
+lookup_module_info cdb_lookup_module_info = { LOOKUP_MODULE_INFO_MAGIC, _lookup_list, 1 };
+
/* End of lookups/cdb.c */