1 /*	$NetBSD: mail_dict.c,v 1.1.1.1 2009/06/23 10:08:46 tron Exp $	*/
2 
3 /*++
4 /* NAME
5 /*	mail_dict 3
6 /* SUMMARY
7 /*	register application-specific dictionaries
8 /* SYNOPSIS
9 /*	#include <mail_dict.h>
10 /*
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 /*--*/
25 
26 /* System library. */
27 
28 #include <sys_defs.h>
29 
30 /* Utility library. */
31 
32 #include <dict.h>
33 #include <msg.h>
34 
35 /* Global library. */
36 
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>
42 
43 typedef struct {
44     char   *type;
45     struct DICT *(*open) (const char *, int, int);
46 } DICT_OPEN_INFO;
47 
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
59     0,
60 };
61 
62 /* mail_dict_init - dictionaries that depend on Postfix-specific interfaces */
63 
64 void    mail_dict_init(void)
65 {
66     const DICT_OPEN_INFO *dp;
67 
68     for (dp = dict_open_info; dp->type; dp++)
69 	dict_open_register(dp->type, dp->open);
70 }
71