Merge branch 'master' of git://git.exim.org/exim
[exim.git] / src / src / lookupapi.h
CommitLineData
e6d225ae
DW
1/* $Cambridge$ */
2
3/*************************************************
4* Exim - an Internet mail transport agent *
5*************************************************/
6
7/* Copyright (c) University of Cambridge 1995 - 2009 */
8/* See the file NOTICE for conditions of use and distribution. */
9
10
11/* The "type" field in each item is a set of bit flags:
12
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)
17*/
18
19typedef 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 */
26 void *, /* handle */
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 */
33 void *, /* handle */
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 */
41 void *); /* handle */
42 void (*tidy)(void); /* tidy function */
43 uschar *(*quote)( /* quoting function */
44 uschar *, /* string to quote */
45 uschar *); /* additional data from quote name */
6545de78
PP
46 void (*version_report)( /* diagnostic function */
47 FILE *); /* fh to write to */
e6d225ae
DW
48} lookup_info;
49
50/* This magic number is used by the following lookup_module_info structure
6545de78
PP
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 */
e6d225ae
DW
54
55typedef struct lookup_module_info {
56 uint magic;
57 lookup_info **lookups;
58 uint lookupcount;
59} lookup_module_info;
60
61/* End of lookupapi.h */