… | |
… | |
158 | |
158 | |
159 | cleanup (); |
159 | cleanup (); |
160 | init (); |
160 | init (); |
161 | } |
161 | } |
162 | |
162 | |
163 | #define parse_bool(target,name,trueval,falseval) \ |
163 | #define parse_bool(target,name,trueval,falseval) do { \ |
164 | if (!strcmp (val, "yes")) target = trueval; \ |
164 | if (!strcmp (val, "yes")) target = trueval; \ |
165 | else if (!strcmp (val, "no")) target = falseval; \ |
165 | else if (!strcmp (val, "no")) target = falseval; \ |
166 | else if (!strcmp (val, "true")) target = trueval; \ |
166 | else if (!strcmp (val, "true")) target = trueval; \ |
167 | else if (!strcmp (val, "false")) target = falseval; \ |
167 | else if (!strcmp (val, "false")) target = falseval; \ |
168 | else if (!strcmp (val, "on")) target = trueval; \ |
168 | else if (!strcmp (val, "on")) target = trueval; \ |
169 | else if (!strcmp (val, "off")) target = falseval; \ |
169 | else if (!strcmp (val, "off")) target = falseval; \ |
170 | else \ |
170 | else \ |
171 | slog (L_WARN, \ |
171 | slog (L_WARN, \ |
172 | _("illegal value for '%s', only 'yes|true|on' or 'no|false|off' allowed, at '%s' line %d"), \ |
172 | _("illegal value for '%s', only 'yes|true|on' or 'no|false|off' allowed, at '%s' line %d"), \ |
173 | name, var, fname, lineno); |
173 | name, var, fname, lineno); \ |
|
|
174 | } while (0) |
174 | |
175 | |
175 | void configuration::read_config (bool need_keys) |
176 | void configuration::read_config (bool need_keys) |
176 | { |
177 | { |
177 | char *fname; |
178 | char *fname; |
178 | FILE *f; |
179 | FILE *f; |