084cafcf6bbdf1414114a7eea1fec1d789e53ea6
[exim.git] / src / src / lookups / cdb.h
1 /* $Cambridge: exim/src/src/lookups/cdb.h,v 1.1 2004/10/07 13:10:01 ph10 Exp $ */
2
3 /*************************************************
4 *     Exim - an Internet mail transport agent    *
5 *************************************************/
6
7 /*
8  * $Id: cdb.h,v 1.2.2.1 1998/05/29 16:21:36 cvs Exp $
9  *
10  * Exim - CDB database lookup module
11  * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
12  *
13  * Copyright (c) 1998 Nigel Metheringham, Planet Online Ltd
14  *
15  * This program is free software; you can redistribute it and/or
16  * modify it under the terms of the GNU General Public License
17  * as published by the Free Software Foundation; either version 2
18  * of the License, or (at your option) any later version.
19  *
20  * This program is distributed in the hope that it will be useful,
21  * but WITHOUT ANY WARRANTY; without even the implied warranty of
22  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
23  * GNU General Public License for more details.
24  *
25  * You should have received a copy of the GNU General Public License
26  * along with this program; if not, write to the Free Software
27  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
28  * 02111-1307, USA.
29  *
30  *
31  * This code implements Dan Bernstein's Constant DataBase (cdb) spec.
32  * Information, the spec and sample code for cdb can be obtained from
33  *      http://www.pobox.com/~djb/cdb.html
34  *
35  * This implementation borrows some code from Dan Bernstein's
36  * implementation (which has no license restrictions applied to it).
37  * This (read-only) implementation is completely contained within
38  * cdb.[ch] it does *not* link against an external cdb library.
39  *
40  *
41  * There are 2 varients included within this code.  One uses MMAP and
42  * should give better performance especially for multiple lookups on a
43  * modern machine.  The other is the default implementation which is
44  * used in the case where the MMAP fails or if MMAP was not compiled
45  * in.  this implementation is the same as the original reference cdb
46  * implementation.
47  *
48  */
49
50
51 /* Functions for reading exim cdb files */
52
53 extern void *cdb_open(uschar *, uschar **);
54 extern BOOL  cdb_check(void *, uschar *, int, uid_t *, gid_t *, uschar **);
55 extern int   cdb_find(void *, uschar *, uschar *, int, uschar **, uschar **,
56                BOOL *);
57 extern void  cdb_close(void *);
58
59 /* End of cdb.h */