summaryrefslogtreecommitdiff
path: root/regress/tinymta/Config.pm
diff options
context:
space:
mode:
Diffstat (limited to 'regress/tinymta/Config.pm')
-rw-r--r--regress/tinymta/Config.pm35
1 files changed, 35 insertions, 0 deletions
diff --git a/regress/tinymta/Config.pm b/regress/tinymta/Config.pm
new file mode 100644
index 00000000..823678db
--- /dev/null
+++ b/regress/tinymta/Config.pm
@@ -0,0 +1,35 @@
+#-*- perl -*-
+#
+# Copyright (C) 2006 Ken'ichi Fukamachi
+# All rights reserved. This program is free software; you can
+# redistribute it and/or modify it under the same terms as Perl itself.
+#
+# $FML$
+#
+
+package TinyMTA::Config;
+use strict;
+use Carp;
+
+# Descriptions: load configuration from $config_cf_file.
+# Arguments: STR($config_cf_file) OBJ($main_cf)
+# Side Effects: none
+# Return Value: OBJ
+sub load_file
+{
+ my ($config_cf_file, $main_cf) = @_;
+
+ my $opts = {};
+ for my $k (keys %$main_cf) {
+ my $key = sprintf("fml_%s", $k);
+ $opts->{ $key } = $main_cf->{ $k };
+ }
+
+ use FML::Config;
+ my $config = new FML::Config $opts;
+ $config->load_file($config_cf_file);
+ return $config;
+}
+
+
+1;