~ubuntu-branches/debian/sid/postfix/sid

« back to all changes in this revision

Viewing changes to src/postconf/postconf_dbms.c

  • Committer: Package Import Robot
  • Author(s): LaMont Jones, LaMont Jones, localization folks
  • Date: 2014-02-11 07:44:30 UTC
  • mfrom: (1.1.41)
  • Revision ID: package-import@ubuntu.com-20140211074430-91tdwgjriazawdz4
Tags: 2.11.0-1
[LaMont Jones]

* New upstream release: 2.11.0

[localization folks]

* l10n: Updated German translations.  Closes: #734893 (Helge Kreutzmann)

Show diffs side-by-side

added added

removed removed

Lines of Context:
6
6
/* SYNOPSIS
7
7
/*      #include <postconf.h>
8
8
/*
9
 
/*      void    register_dbms_parameters(param_value, flag_parameter,
 
9
/*      void    pcf_register_dbms_parameters(param_value, flag_parameter,
10
10
/*                                      local_scope)
11
11
/*      const char *param_value;
12
 
/*      const char *(flag_parameter) (const char *, int, PC_MASTER_ENT *);
13
 
/*      PC_MASTER_ENT *local_scope;
 
12
/*      const char *(flag_parameter) (const char *, int, PCF_MASTER_ENT *);
 
13
/*      PCF_MASTER_ENT *local_scope;
14
14
/* DESCRIPTION
15
15
/*      This module implements legacy support for database configuration
16
16
/*      where main.cf parameter names are generated by prepending
25
25
/*      names for that database type.
26
26
/* .IP flag_parameter
27
27
/*      A function that takes as arguments a candidate parameter
28
 
/*      name, parameter flags, and a PC_MASTER_ENT pointer.  The
 
28
/*      name, parameter flags, and a PCF_MASTER_ENT pointer.  The
29
29
/*      function will flag the parameter as "used" if it has a
30
30
/*      "name=value" entry in the local or global namespace.
31
31
/* .IP local_scope
83
83
 
84
84
/* See ldap_table(5). */
85
85
 
86
 
static const char *ldap_suffixes[] = {
 
86
static const char *pcf_ldap_suffixes[] = {
87
87
    "bind", "bind_dn", "bind_pw", "cache", "cache_expiry", "cache_size",
88
88
    "chase_referrals", "debuglevel", "dereference", "domain",
89
89
    "expansion_limit", "leaf_result_attribute", "query_filter",
95
95
 
96
96
/* See mysql_table(5). */
97
97
 
98
 
static const char *mysql_suffixes[] = {
 
98
static const char *pcf_mysql_suffixes[] = {
99
99
    "additional_conditions", "dbname", "domain", "expansion_limit",
100
100
    "hosts", "password", "query", "result_format", "select_field",
101
101
    "table", "user", "where_field", 0,
103
103
 
104
104
/* See pgsql_table(5). */
105
105
 
106
 
static const char *pgsql_suffixes[] = {
 
106
static const char *pcf_pgsql_suffixes[] = {
107
107
    "additional_conditions", "dbname", "domain", "expansion_limit",
108
108
    "hosts", "password", "query", "result_format", "select_field",
109
109
    "select_function", "table", "user", "where_field", 0,
111
111
 
112
112
/* See sqlite_table(5). */
113
113
 
114
 
static const char *sqlite_suffixes[] = {
 
114
static const char *pcf_sqlite_suffixes[] = {
115
115
    "additional_conditions", "dbpath", "domain", "expansion_limit",
116
116
    "query", "result_format", "select_field", "table", "where_field",
117
117
    0,
119
119
 
120
120
/* See memcache_table(5). */
121
121
 
122
 
static const char *memcache_suffixes[] = {
 
122
static const char *pcf_memcache_suffixes[] = {
123
123
    "backup", "data_size_limit", "domain", "flags", "key_format",
124
124
    "line_size_limit", "max_try", "memcache", "retry_pause",
125
125
    "timeout", "ttl", 0,
131
131
typedef struct {
132
132
    const char *db_type;
133
133
    const char **db_suffixes;
134
 
} PC_DBMS_INFO;
 
134
} PCF_DBMS_INFO;
135
135
 
136
 
static const PC_DBMS_INFO dbms_info[] = {
137
 
    DICT_TYPE_LDAP, ldap_suffixes,
138
 
    DICT_TYPE_MYSQL, mysql_suffixes,
139
 
    DICT_TYPE_PGSQL, pgsql_suffixes,
140
 
    DICT_TYPE_SQLITE, sqlite_suffixes,
141
 
    DICT_TYPE_MEMCACHE, memcache_suffixes,
 
136
static const PCF_DBMS_INFO pcf_dbms_info[] = {
 
137
    DICT_TYPE_LDAP, pcf_ldap_suffixes,
 
138
    DICT_TYPE_MYSQL, pcf_mysql_suffixes,
 
139
    DICT_TYPE_PGSQL, pcf_pgsql_suffixes,
 
140
    DICT_TYPE_SQLITE, pcf_sqlite_suffixes,
 
141
    DICT_TYPE_MEMCACHE, pcf_memcache_suffixes,
142
142
    0,
143
143
};
144
144
 
145
 
/* register_dbms_parameters - look for database_type:prefix_name */
 
145
/* pcf_register_dbms_parameters - look for database_type:prefix_name */
146
146
 
147
 
void    register_dbms_parameters(const char *param_value,
148
 
          const char *(flag_parameter) (const char *, int, PC_MASTER_ENT *),
149
 
                                         PC_MASTER_ENT *local_scope)
 
147
void    pcf_register_dbms_parameters(const char *param_value,
 
148
         const char *(flag_parameter) (const char *, int, PCF_MASTER_ENT *),
 
149
                                             PCF_MASTER_ENT *local_scope)
150
150
{
151
 
    const PC_DBMS_INFO *dp;
 
151
    const PCF_DBMS_INFO *dp;
152
152
    char   *bufp;
153
153
    char   *db_type;
154
154
    char   *prefix;
163
163
     */
164
164
    if (buffer == 0)
165
165
        buffer = vstring_alloc(100);
166
 
    bufp = expand_parameter_value(buffer, SHOW_EVAL, param_value, local_scope);
 
166
    bufp = pcf_expand_parameter_value(buffer, PCF_SHOW_EVAL, param_value,
 
167
                                      local_scope);
167
168
 
168
169
    /*
169
170
     * Naive parsing. We don't really know if the parameter specifies free
187
188
         * local or global namespace.
188
189
         */
189
190
        if (prefix != 0 && *prefix != '/' && *prefix != '.') {
190
 
            for (dp = dbms_info; dp->db_type != 0; dp++) {
 
191
            for (dp = pcf_dbms_info; dp->db_type != 0; dp++) {
191
192
                if (strcmp(db_type, dp->db_type) == 0) {
192
193
                    for (cpp = dp->db_suffixes; *cpp; cpp++) {
193
194
                        vstring_sprintf(candidate ? candidate :
194
195
                                        (candidate = vstring_alloc(30)),
195
196
                                        "%s_%s", prefix, *cpp);
196
197
                        flag_parameter(STR(candidate),
197
 
                                    PC_PARAM_FLAG_DBMS | PC_PARAM_FLAG_USER,
 
198
                                  PCF_PARAM_FLAG_DBMS | PCF_PARAM_FLAG_USER,
198
199
                                       local_scope);
199
200
                    }
200
201
                    break;