Patrick Welche <prlw1@cam.ac.uk>
[netbsd-mini2440.git] / external / ibm-public / postfix / dist / src / global / mail_dict.c
blobb8d81f8c9c0faa3ce209dd4dd1594d11ebc554a9
1 /* $NetBSD$ */
3 /*++
4 /* NAME
5 /* mail_dict 3
6 /* SUMMARY
7 /* register application-specific dictionaries
8 /* SYNOPSIS
9 /* #include <mail_dict.h>
11 /* void mail_dict_init()
12 /* DESCRIPTION
13 /* This module registers dictionary types that depend on higher-level
14 /* Postfix-specific interfaces and protocols.
15 /* LICENSE
16 /* .ad
17 /* .fi
18 /* The Secure Mailer license must be distributed with this software.
19 /* AUTHOR(S)
20 /* Wietse Venema
21 /* IBM T.J. Watson Research
22 /* P.O. Box 704
23 /* Yorktown Heights, NY 10598, USA
24 /*--*/
26 /* System library. */
28 #include <sys_defs.h>
30 /* Utility library. */
32 #include <dict.h>
33 #include <msg.h>
35 /* Global library. */
37 #include <dict_proxy.h>
38 #include <dict_ldap.h>
39 #include <dict_mysql.h>
40 #include <dict_pgsql.h>
41 #include <mail_dict.h>
43 typedef struct {
44 char *type;
45 struct DICT *(*open) (const char *, int, int);
46 } DICT_OPEN_INFO;
48 static const DICT_OPEN_INFO dict_open_info[] = {
49 DICT_TYPE_PROXY, dict_proxy_open,
50 #ifdef HAS_LDAP
51 DICT_TYPE_LDAP, dict_ldap_open,
52 #endif
53 #ifdef HAS_MYSQL
54 DICT_TYPE_MYSQL, dict_mysql_open,
55 #endif
56 #ifdef HAS_PGSQL
57 DICT_TYPE_PGSQL, dict_pgsql_open,
58 #endif
62 /* mail_dict_init - dictionaries that depend on Postfix-specific interfaces */
64 void mail_dict_init(void)
66 const DICT_OPEN_INFO *dp;
68 for (dp = dict_open_info; dp->type; dp++)
69 dict_open_register(dp->type, dp->open);