-sub list_404 ($$) { [] }
-
-# TODO: +cgit
-my %VALID = (
- all => *list_all,
- 'match=domain' => *list_match_domain,
- 404 => *list_404,
-);
-
-sub new {
- my ($class, $www) = @_;
- my $k = 'publicinbox.wwwListing';
- my $pi_config = $www->{pi_config};
- my $v = $pi_config->{lc($k)} // 404;
- bless {
- pi_config => $pi_config,
- style => $www->style("\0"),
- list_cb => $VALID{$v} || do {
- warn <<"";
-`$v' is not a valid value for `$k'
-$k be one of `all', `match=domain', or `404'
+sub list_match_i { # ConfigIter callback
+ my ($cfg, $section, $re, $ctx) = @_;
+ if (defined($section)) {
+ return if $section !~ m!\Apublicinbox\.([^/]+)\z!;
+ my $ibx = $cfg->lookup_name($1) or return;
+ if (!$ibx->{-hide}->{$ctx->hide_key} &&
+ grep(/$re/, @{$ibx->{url}})) {
+ $ctx->ibx_entry($ibx);
+ }
+ } else { # undef == "EOF"
+ $ctx->{-wcb}->($ctx->psgi_triple);
+ }
+}