use strict;

texinfo_register_file_id_setting_function('special_unit_target_file_name',
                                          \&toc_out_element_file_name);

sub toc_out_element_file_name($$$$$)
{
    my $converter = shift;
    my $element = shift;
    my $target = shift;
    my $filename = shift;

    my $prefix = $converter->get_info('document_name');
    my $type = $element->{'special_unit_variety'};
    if ($type and $type ne 'contents')
    {
        $filename = "$prefix.".$converter->get_conf('EXTENSION');
    }
    return ($target, $filename);
}

1;
