f2cd173a084d6aafbbcdb68fc8f8ee3da468a57dTimo Sirainenprint "/* WARNING: THIS FILE IS GENERATED - DO NOT PATCH!\n";
f2cd173a084d6aafbbcdb68fc8f8ee3da468a57dTimo Sirainenprint " It's not enough alone in any case, because the defaults may be\n";
f2cd173a084d6aafbbcdb68fc8f8ee3da468a57dTimo Sirainenprint " coming from the individual *-settings.c in some situations. If you\n";
f2cd173a084d6aafbbcdb68fc8f8ee3da468a57dTimo Sirainenprint " wish to modify defaults, change the other *-settings.c files and\n";
f2cd173a084d6aafbbcdb68fc8f8ee3da468a57dTimo Sirainenprint " just delete this file. This file will be automatically regenerated\n";
f2cd173a084d6aafbbcdb68fc8f8ee3da468a57dTimo Sirainenprint " by make. (This file is distributed in the tarball only because some\n";
f2cd173a084d6aafbbcdb68fc8f8ee3da468a57dTimo Sirainenprint " systems might not have Perl installed.) */\n";
9f0f2de10e4ea0c99052bf4b2bef8179f2536228Timo Sirainenprint 'extern buffer_t config_all_services_buf;';
a64adf62fa33f2463a86f990217b0c9078531a40Timo Sirainen open($f, $file) || die "Can't open $file: $@";
a64adf62fa33f2463a86f990217b0c9078531a40Timo Sirainen while (<$f>) {
e50a72961fca1d979afabb05e2e0e05261aac566Timo Sirainen } elsif (/^struct service_settings (.*) = \{/) {
e50a72961fca1d979afabb05e2e0e05261aac566Timo Sirainen } elsif (/^(static )?const struct setting_parser_info (.*) = \{/) {
7744586e3e0fd60158abfbb03a233d3bd8d6c48bTimo Sirainen } elsif (/^extern const struct setting_parser_info (.*);/) {
7744586e3e0fd60158abfbb03a233d3bd8d6c48bTimo Sirainen $externs .= "extern const struct setting_parser_info $1;\n";
f9007013ea59b844e95fe32022eaf8852ba7e5a6Timo Sirainen if (/(^#ifdef .*)$/ || /^(#if .*)$/) {
d176f84ce5ca2073f4dfbafb457b9c74f6bf0d76Timo Sirainen if (/#define.*DEF/ || /^#undef.*DEF/ || /ARRAY_DEFINE_TYPE.*_settings/) {
b215a8a123623782554a83f3025ef4e771bd8f01Timo Sirainen $state = 0 if (/\/\* <\/settings checks> \*\//);
a64adf62fa33f2463a86f990217b0c9078531a40Timo Sirainen if ($value =~ /.*&(.*)\)/) {
7744586e3e0fd60158abfbb03a233d3bd8d6c48bTimo Sirainen $externs .= "extern const struct setting_parser_info $1;\n";
a64adf62fa33f2463a86f990217b0c9078531a40Timo Sirainen if (/.*&(.*)\)/) {
12ab808b472ed51923945efac4156a380bd58d57Timo Sirainen s/^static const (struct master_settings master_default_settings)/$1/;
f9007013ea59b844e95fe32022eaf8852ba7e5a6Timo Sirainen $_ .= "#endif\n";
a64adf62fa33f2463a86f990217b0c9078531a40Timo Sirainen print "/* $file */\n";
9f0f2de10e4ea0c99052bf4b2bef8179f2536228Timo Sirainenprint "static struct service_settings *config_all_services[] = {\n";
f9007013ea59b844e95fe32022eaf8852ba7e5a6Timo Sirainenfor (my $i = 0; $i < scalar(@services); $i++) {
9f0f2de10e4ea0c99052bf4b2bef8179f2536228Timo Sirainenprint "buffer_t config_all_services_buf = {\n";
da7f1a07f583df8905684a7b78469960afd7c78dPhil Carmodyprint "\tconfig_all_services, sizeof(config_all_services), { NULL, }\n";
fc4b301e2dd86c096b9c41ad1b011b752fffd570Timo Sirainenprint "const struct setting_parser_info *all_default_roots[] = {\n";
7020f569b419641e2887cf05a898947afcbb7bf1Timo Sirainenprint "\t&master_service_setting_parser_info,\n";
7020f569b419641e2887cf05a898947afcbb7bf1Timo Sirainenprint "\t&master_service_ssl_setting_parser_info,\n";
0f72f253d5a117dad2f28b2ce336190a5e6b79c8Stephan Boschprint "\t&smtp_submit_setting_parser_info,\n";
1cfdcb36985904eff281fc6d7ea2d13b3c375980Timo Sirainenprint "\tNULL\n";
fc4b301e2dd86c096b9c41ad1b011b752fffd570Timo Sirainenprint "const struct setting_parser_info *const *all_roots = all_default_roots;\n";
12ab808b472ed51923945efac4156a380bd58d57Timo Sirainenprint "ARRAY_TYPE(service_settings) *default_services = &master_default_settings.services;\n";