+sub getChanConfDefault {
+ my ( $what, $default, $chan ) = @_;
+ $chan ||= '_default';
+
+ if ( exists $param{$what} ) {
+ if ( !exists $cache{config}{$what} ) {
+ &status(
+"config ($chan): backward-compatible option: found param{$what} ($param{$what}) instead of chan option"
+ );
+ $cache{config}{$what} = 1;
+ }
+
+ return $param{$what};
+ }
+ my $val = &getChanConf( $what, $chan );
+ return $val if ( defined $val );
+
+ $param{$what} = $default;
+ &status("config ($chan): auto-setting param{$what} = $default");
+ $cache{config}{$what} = 1;
+ return $default;
+}
+
+#####
+# Usage: &findChanConf($param);
+# About: Retrieve value for 'param' value from any chan.
+# Return: scalar for success, undef for failure.
+sub findChanConf {
+ my ($param) = @_;
+
+ if ( !defined $param ) {
+ &WARN('param == NULL.');
+ return 0;
+ }