Sync usage with man page.
[netbsd-mini2440.git] / external / ibm-public / postfix / dist / src / global / match_parent_style.c
blobde13e8240a1ea65265359f3c2d40e021ce95d6d4
1 /* $NetBSD$ */
3 /*++
4 /* NAME
5 /* match_parent_style 3
6 /* SUMMARY
7 /* parent domain matching control
8 /* SYNOPSIS
9 /* #include <match_parent_style.h>
11 /* int match_parent_style(name)
12 /* const char *name;
13 /* DESCRIPTION
14 /* This module queries configuration parameters for the policy that
15 /* controls how wild-card parent domain names are used by various
16 /* postfix lookup mechanisms.
18 /* match_parent_style() looks up "name" in the
19 /* parent_domain_matches_subdomain configuration parameter
20 /* and returns either MATCH_FLAG_PARENT (parent domain matches
21 /* subdomains) or MATCH_FLAG_NONE.
22 /* DIAGNOSTICS
23 /* Fatal error: out of memory, name listed under both parent wild card
24 /* matching policies.
25 /* SEE ALSO
26 /* string_list(3) plain string matching
27 /* domain_list(3) match host name patterns
28 /* namadr_list(3) match host name/address patterns
29 /* LICENSE
30 /* .ad
31 /* .fi
32 /* The Secure Mailer license must be distributed with this software.
33 /* AUTHOR(S)
34 /* Wietse Venema
35 /* IBM T.J. Watson Research
36 /* P.O. Box 704
37 /* Yorktown Heights, NY 10598, USA
38 /*--*/
40 /* System library. */
42 #include <sys_defs.h>
44 /* Utility library. */
46 /* Global library. */
48 #include <string_list.h>
49 #include <mail_params.h>
50 #include <match_parent_style.h>
52 /* Application-specific. */
54 static STRING_LIST *match_par_dom_list;
56 int match_parent_style(const char *name)
58 int result;
61 * Initialize on the fly.
63 if (match_par_dom_list == 0)
64 match_par_dom_list =
65 string_list_init(MATCH_FLAG_NONE, var_par_dom_match);
68 * Look up the parent domain matching policy.
70 if (string_list_match(match_par_dom_list, name))
71 result = MATCH_FLAG_PARENT;
72 else
73 result = 0;
74 return (result);