#!/usr/bin/perl -w

my $out, $err;
$out = STDOUT;
$err = STDERR;
my $firstarg = '\(\'([^\']+)\'';

while (<>) {
    if (m/->lookup_with_schema_name $firstarg/ ||
	m/->dir_exists $firstarg/) {
	print $out "$1\n";
    } elsif (m/->all_entries_with_schema_name $firstarg/ ||
	     m/->all_dirs $firstarg/) {
	print $out "$1/*\n";
    } elsif (m/->ping \(\)/ || m/->sync \(\)/ ||
	     m/->notify ()/ || m/->add_listener_with_properties / ||
	     m/->add_client ()/ || m/->get_default_database / ||
	     m/->remove_listener / || m/->get_database_for_addresses / ||
	     m/->get_database / ) {
	# things to ignore
    } elsif (m/->set $firstarg/ || m/->unset $firstarg/) {
	print $out "$1\n";
    } else {
	print $err "Unknown line: $_\n";
    }
}
