3 /*************************************************
4 * Exim - an Internet mail transport agent *
5 *************************************************/
7 /* Copyright (c) University of Cambridge 1995 - 2009 */
8 /* See the file NOTICE for conditions of use and distribution. */
11 /* The "type" field in each item is a set of bit flags:
13 lookup_querystyle => this is a query-style lookup,
14 else single-key (+ file) style
15 lookup_absfile => an absolute file name is required,
16 (for single-key style only)
19 typedef struct lookup_info {
20 uschar *name; /* e.g. "lsearch" */
21 int type; /* query/singlekey/abs-file */
22 void *(*open)( /* open function */
23 uschar *, /* file name for those that have one */
24 uschar **); /* for error message */
25 BOOL (*check)( /* file checking function */
27 uschar *, /* file name */
28 int, /* modemask for file checking */
29 uid_t *, /* owners for file checking */
30 gid_t *, /* owngroups for file checking */
31 uschar **); /* for error messages */
32 int (*find)( /* find function */
34 uschar *, /* file name or NULL */
35 uschar *, /* key or query */
36 int, /* length of key or query */
37 uschar **, /* for returning answer */
38 uschar **, /* for error message */
39 BOOL *); /* to request cache cleanup */
40 void (*close)( /* close function */
42 void (*tidy)(void); /* tidy function */
43 uschar *(*quote)( /* quoting function */
44 uschar *, /* string to quote */
45 uschar *); /* additional data from quote name */
46 void (*version_report)( /* diagnostic function */
47 FILE *); /* fh to write to */
50 /* This magic number is used by the following lookup_module_info structure
51 for checking API compatibility. It's equivalent to the string"LMM2" */
52 #define LOOKUP_MODULE_INFO_MAGIC 0x4c4d4d32
53 /* Version 2 adds: version_report */
55 typedef struct lookup_module_info {
57 lookup_info **lookups;
61 /* End of lookupapi.h */