#'lbracechar' => '{', #'rbracechar' => '}', # symbols 'arrow' => '→', 'bullet' => '•', 'copyright' => '©', 'dots' => '…', #'enddots' => '...', 'equiv' => '≡', 'euro' => '€', 'exclamdown' => '¡', 'expansion' => '→', 'geq' => '≥', #'LaTeX' => 'LaTeX', 'leq' => '≤', 'minus' => '−', 'ordf' => 'ª', 'ordm' => 'º', 'point' => '∗', 'pounds' => '£', #'print' => '-|', 'questiondown' => '¿', 'registeredsymbol' => '®', 'result' => '⇒', #'TeX' => 'TeX', 'textdegree' => '°', # quotes 'guillemetleft' => '«', 'guillemetright' => '»', 'guillemotleft' => '«', 'guillemotright' => '»', 'guilsinglleft' => '‹', 'guilsinglright' => '›', 'quotedblbase' => '„', 'quotedblleft' => '“', 'quotedblright' => '”', 'quoteleft' => '‘', 'quoteright' => '’', 'quotesinglbase' => '‚', # letters 'AA' => 'Å', 'aa' => 'å', 'AE' => 'Æ', 'ae' => 'æ', 'DH' => 'Ð', 'dh' => 'ð', 'L' => 'Ł', 'l' => 'ł', 'OE' => 'Œ', # Œ not in html 3.2 'oe' => 'œ', # œ not in html 3.2 'O' => 'Ø', 'o' => 'ø', 'ss' => 'ß', 'TH' => 'Þ', 'th' => 'þ', # other 'click' => '→', # in general the following is not used since error # appears in 'translated_commands' 'error' => 'error-->', 'tie' => ' ', ); our %xml_text_entity_no_arg_commands_formatting = %xml_text_entity_no_arg_commands; foreach my $brace_no_arg_command (keys(%Texinfo::Common::text_brace_no_arg_commands)) { if (!defined($xml_text_entity_no_arg_commands_formatting{ $brace_no_arg_command})) { $xml_text_entity_no_arg_commands_formatting{$brace_no_arg_command} = $Texinfo::Common::text_brace_no_arg_commands{$brace_no_arg_command}; } } foreach my $no_brace_command (keys(%Texinfo::Common::nobrace_symbol_text)) { if (!defined($xml_text_entity_no_arg_commands_formatting{ $no_brace_command})) { $xml_text_entity_no_arg_commands_formatting{$no_brace_command} = $Texinfo::Common::nobrace_symbol_text{$no_brace_command}; } } sub xml_comment($$) { my $self = shift; my $text = shift; chomp $text; $text =~ s/--+/-/go; return '' . "\n"; } our %xml_accent_entities = ( '"', 'uml', '~', 'tilde', '^', 'circ', '`', 'grave', "'", 'acute', ",", 'cedil', 'ringaccent', 'ring', 'ogonek', 'ogon', 'dotless', 'nodot', ); our %xml_accent_text_with_entities = ( 'ringaccent' => 'aA', "'" => 'aeiouyAEIOUY', ',' => 'cC', '^' => 'aeiouAEIOU', '`' => 'aeiouAEIOU', '~' => 'nNaoAO', '"' => 'aeiouyAEIOU', 'dotless' => 'i', # according to http://www2.lib.virginia.edu/small/vhp/download/ISO.txt # however this doesn't seems to work in firefox # 'ogonek' => 'aeiuAEIU', ); sub xml_numeric_entity_accent($$) { my $accent = shift; my $text = shift; if (exists($Texinfo::Convert::Unicode::unicode_accented_letters{$accent}) and exists($Texinfo::Convert::Unicode::unicode_accented_letters{$accent}->{$text})) { return '&#' . hex($Texinfo::Convert::Unicode::unicode_accented_letters{$accent}->{$text}). ';'; } if (exists($Texinfo::Convert::Unicode::unicode_diacritics{$accent})) { my $diacritic = '&#' .hex($Texinfo::Convert::Unicode::unicode_diacritics{$accent}). ';'; if ($accent ne 'tieaccent') { return $text . $diacritic; } else { # tieaccent diacritic is naturally and correctly composed # between two characters my $remaining_text = $text; # we consider that letters are either characters or entities if ($remaining_text =~ s/^([\p{L}\d]|&[a-zA-Z0-9]+;)([\p{L}\d]|&[a-zA-Z0-9]+;)(.*)$/$3/) { return $1.$diacritic.$2 . $remaining_text; } else { return $text . $diacritic; } } } return undef; } sub xml_accent($$$;$$$) { my $self = shift; my $text = shift; my $command = shift; my $in_upper_case = shift; my $use_numeric_entities = shift; my $accent = $command->{'cmdname'}; if ($in_upper_case and $text =~ /^\w$/) { $text = uc ($text); } # do not return a dotless i or j as such if it is further composed # with an accented letter, return the letter as is if ($accent eq 'dotless') { if ($Texinfo::Convert::Unicode::unicode_accented_letters{$accent} and exists($Texinfo::Convert::Unicode::unicode_accented_letters{$accent}->{$text}) and ($command->{'parent'} and $command->{'parent'}->{'parent'} and $command->{'parent'}->{'parent'}->{'cmdname'} and $Texinfo::Convert::Unicode::unicode_accented_letters{$command->{'parent'} ->{'parent'}->{'cmdname'}})) { return $text; } } if ($use_numeric_entities) { my $formatted_accent = xml_numeric_entity_accent($accent, $text); if (defined($formatted_accent)) { return $formatted_accent; } } else { return "&${text}$xml_accent_entities{$accent};" if (defined($xml_accent_entities{$accent}) and defined($xml_accent_text_with_entities{$accent}) and ($text =~ /^[$xml_accent_text_with_entities{$accent}]$/)); my $formatted_accent = xml_numeric_entity_accent($accent, $text); if (defined($formatted_accent)) { return $formatted_accent; } } # There are diacritics for every accent command except for dotless. # We should only get there with dotless if the argument is not recognized. return $text; } sub _xml_numeric_entities_accent($$$;$) { my $self = shift; my $text = shift; my $command = shift; my $in_upper_case = shift; return xml_accent($self, $text, $command, $in_upper_case, 1); } sub xml_accents($$;$) { my $self = shift; my $accent = shift; my $in_upper_case = shift; my $format_accents; if ($self->get_conf('USE_NUMERIC_ENTITY')) { $format_accents = \&_xml_numeric_entities_accent; } else { $format_accents = \&xml_accent; } return $self->convert_accents($accent, $format_accents, $self->get_conf('OUTPUT_CHARACTERS'), $in_upper_case); } 1; __END__ =head1 NAME Texinfo::Convert::Converter - Parent class for Texinfo tree converters =head1 SYNOPSIS package Texinfo::Convert::MyConverter; use Texinfo::Convert::Converter; @ISA = qw(Texinfo::Convert::Converter); sub converter_defaults ($$) { return \%myconverter_defaults; } sub converter_initialize($) { my $self = shift; ... } sub conversion_initialization($;$) { my $self = shift; my $document = shift; if ($document) { $self->set_document($document); } $self->{'document_context'} = [{}]; ... } sub conversion_finalization($) { my $self = shift; } sub convert_tree($$) { ... } sub convert($$) { my $self = shift; my $document = shift; $self->conversion_initialization($document); ... $self->conversion_finalization(); } sub output($$) { my $self = shift; my $document = shift; $self->conversion_initialization($document); ... $self->conversion_finalization(); ... } # end of Texinfo::Convert::MyConverter my $converter = Texinfo::Convert::MyConverter->converter(); $converter->output($texinfo_parsed_document); =head1 NOTES The Texinfo Perl module main purpose is to be used in C to convert Texinfo to other formats. There is no promise of API stability. =head1 DESCRIPTION C is a super class that can be used to simplify converters initialization. The class also provide some useful methods. In turn, the converter should define some methods for conversion. In general C, C and C should be defined. =over =item $result = $converter->convert_tree($tree) X> The C method is mandatory and should convert portions of Texinfo tree. Takes a I<$converter> and Texinfo tree I<$tree> in arguments. Returns the converted output. =item $result = $converter->output($document) =item $result = $converter->output_tree($document) X>X> The C method is used by converters as entry point for conversion to a file with headers and so on. This method should be implemented by converters. C is called from C. C takes a I<$converter> and a Texinfo parsed document C I<$document> as arguments. C implements a generic C function suitable for conversion of the Texinfo tree, with the conversion result output into a file or returned from the function. C takes a I<$converter> and a Texinfo parsed document C I<$document> as arguments. In a converter that uses C, C is in general defined as: sub output($$) { my $self = shift; my $document = shift; return $self->output_tree($document); } In general, C and C output to files and return C. When the output file name is an empty string, however, it is customary for C and C to return the output as a character string instead. The output file name is obtained in C through a call to L<<< C|/($output_file, $destination_directory, $output_filename, $document_name, $input_basefile) = $converter->determine_files_and_directory($output_format) >>>. In general C is also used when C is not used. =item $result = $converter->convert($document) X> Entry point for the conversion of a Texinfo parsed document to an output format, without the headers usually done when outputting to a file. C takes a I<$converter> and a Texinfo parsed document C I<$document> as arguments. Returns the output as a character string. Not mandatory, not called from C, but used in the C test suite. =item $result = $converter->convert_output_unit($output_unit) X> Can be used for the conversion of output units by converters. C takes a I<$converter> and an output unit I<$output_unit> as argument. The implementation of C of C could be suitable in many cases. Output units are typically returned by L C|Texinfo::OutputUnits/$output_units = split_by_section($document)> or L C|Texinfo::OutputUnits/$output_units = split_by_node($document)>. =back Two methods, C and C are used for initialization, to give information to C and can be redefined in converters. To help with the conversion, the C function associates a C to a converter. Other methods are called in default implementations to be redefined to call code at specific moments of the conversion. C, for instance, is generally called at the beginning of C, C and C. C is generally called at the end of C, C and C. C also calls the C method before the Texinfo tree conversion to obtain the beginning of the output. C calls the C method after the Texinfo tree conversion to obtain the end of the output. For output formats based on output units conversion, the C C method could be a good starting point. HTML and Info output are also based on output units conversion. Output units are not relevant for all the formats, the Texinfo tree can also be converted directly, in general by using C. This is how the other Converters are implemented. Existing backends based on C may be used as examples. C together with C, as well as C are trivial examples. C is less trivial, although still simple, while C is a real converter that is also not too complex. The documentation of L, L, L and L describes modules or additional function that may be useful for backends, while the parsed Texinfo tree is described in L. =head1 METHODS =head2 Converter Initialization X> X initialization> A module subclassing C is created by calling the C method that should be inherited from C. =over =item $converter = MyConverter->converter($options) The I<$options> hash reference holds options for the converter. These options should be Texinfo customization options. The customization options are described in the Texinfo manual or in the customization API manual. The C function returns a converter object (a blessed hash reference) after checking the options and performing some initializations. =back To help with the initializations, the modules subclassing C can define two methods: =over =item \%defaults = $converter_or_class->converter_defaults($options) X> Returns a reference on a hash with defaults for the converter module customization options or C. The I<$options> hash reference holds options for the converter. This method is called through a converter by L<<< C|/$converter = MyConverter->converter($options) >>>, but it may also be called through a converter module class. =item converter_initialize X> This method is called at the end of the C converter initialization. =back =head2 Conversion For conversion with C and C a document to convert should be associated to the converter, in general the document passed in argument of C or C. The C function associates a C to a converter. This function is used in the default implementations. =over =item $converter->set_document($document) X> Associate I<$document> to I<$converter>. Also set the encoding related customization options based on I<$converter> customization information and information on document encoding, and setup converter hash C value that can be used to call L|Texinfo::Convert::Text/$result = convert_to_text($tree, $text_options)>. =back The C, C, C and C can be redefined to call code at diverse moments: =over =item $converter->conversion_initialization($document) =item $converter->conversion_finalization() X>X> C is called at the beginning of C and of the default implementations of the C and C functions. C is called at the end of C and of the default C and C methods implementations. These functions should be redefined to have code run before a document conversion and after the document conversion. In the default case, C calls L<< set_document|/$converter->set_document($document) >> to associate the C document passed in argument to the converter. A subclass converter redefining C should in general call C in the redefined function too to associate the converted document to the converter. =item $beginning = $converter->conversion_output_begin($output_file, $output_filename) =item $end = $converter->conversion_output_end() X>X> C returned string I<$beginning> is output by the C calling method before the Texinfo tree conversion. The I<$output_file> argument is the output file path. If I<$output_file> is an empty string, it means that text will be returned by the converter instead of being written to an output file. I<$output_filename> is, in general, the file name portion of I<$output_file> (without directory) but can also be set based on C<@setfilename>. C returned string I<$end> is output by the C calling method after the Texinfo tree conversion. The default methods implementations return an empty string. =back Calling C and, if needed, C in redefined C and C methods is not mandated, but it is recommended to have similar converter codes. In subclassed converters that do not need to define C, calling the default C C implementation is also recommended to avoid having to explictely call C. If C is defined in a converter subclass it is recommended to call C at the very beginning of the function to have the document associated to the converter. =head2 Getting and setting customization variables C implements a simple interface to set and retrieve Texinfo customization variables. Helper functions from diverse Texinfo modules needing customization information expect an object implementing C and/or C. The converter itself can therefore be used in such cases. Customization variables are typically setup when initializing a converter with L<<< C|/$converter = MyConverter->converter($options) >>> and completed by Texinfo informative @-commands tree element values, for commands such as C<@frenchspacing> or C<@footnotestyle>. =over =item $converter->force_conf($variable_name, $variable_value) X> Set the Texinfo customization option I<$variable_name> to I<$variable_value>. This should rarely be used, but the purpose of this method is to be able to revert a customization that is always wrong for a given output format, like the splitting for example. =item $converter->get_conf($variable_name) X> Returns the value of the Texinfo customization variable I<$variable_name>. =item $status = $converter->set_conf($variable_name, $variable_value) X> Set the Texinfo customization option I<$variable_name> to I<$variable_value> if not set as a converter option. Returns false if the customization options was not set. =back =head2 Registering error and warning messages C implements an interface to register error and warning messages in the converter, that can be retrieved later on, in general to be given to C. Underneath, C is used to setup the messages data structure. =over =item $converter->converter_document_error($text, $continuation) =item $converter->converter_document_warn($text, $continuation) X>X> Register a warning or an error. The I<$text> is the text of the error or warning. The I<$continuation> optional arguments, if true, conveys that the line is a continuation line of a message. =item $converter->converter_line_error($text, $error_location_info, $continuation) =item $converter->converter_line_warn($text, $error_location_info, $continuation) X>X> Register a warning or an error with a line information. The I<$text> is the text of the error or warning. The I<$error_location_info> argument holds the information on the error or warning location. The I<$error_location_info> reference on hash may be obtained from Texinfo elements I keys. It may also be setup to point to a file name, using the C key and to a line number, using the C key. The C key value should be a binary string. The I<$continuation> optional arguments, if true, conveys that the line is a continuation line of a message. =item \@error_warning_messages = $converter->get_converter_errors() X> Return a reference on an array containing the error or warning messages registered in the converter. Error and warning messages are hash references as described in L and can be used in input of L<< Texinfo::Report::add_formatted_message|Texinfo::Report/$registrar->add_formatted_message ($msg) >>. =back =head2 Translations in output documents C provides wrappers around L methods that sets the language to the current C. The C and C methods are used to translate strings to be output in converted documents, and return a Texinfo tree. The C is similar but returns a simple string, for already converted strings. =over =item $tree = $converter->cdt($string, $replaced_substrings, $translation_context) =item $string = $converter->cdt_string($string, $replaced_substrings, $translation_context) X> X> The I<$string> is a string to be translated. With C the function returns a Texinfo tree, as the string is interpreted as Texinfo code after translation. With C a string is returned. I<$replaced_substrings> is an optional hash reference specifying some substitution to be done after the translation. The key of the I<$replaced_substrings> hash reference identifies what is to be substituted. In the string to be translated word in brace matching keys of I<$replaced_substrings> are replaced. For C, the value is a Texinfo tree that is substituted in the resulting Texinfo tree. For C, the value is a string that is replaced in the resulting string. The I<$translation_context> is optional. If not C this is a translation context string for I<$string>. It is the first argument of C in the C API of Gettext. =item $tree = $object->pcdt($translation_context, $string, $replaced_substrings) X> Same to C except that the I<$translation_context> is not optional. This function is useful to mark strings with a translation context for translation. This function is similar to pgettext in the Gettext C API. =back =head2 Index sorting You should call the following methods to sort indices in conversion: =over =item $sorted_indices = $converter->get_converter_indices_sorted_by_index() =item $sorted_indices = $converter->get_converter_indices_sorted_by_letter() X> X> C returns the indices sorted by index and letter, while C returns the indices with all entries of an index together. When sorting by letter, an array reference of letter hash references is associated with each index name. Each letter hash reference has two keys, a I key with the letter, and an I key with an array reference of sorted index entries beginning with the letter. The letter is a character string suitable for sorting letters, but is not necessarily the best to use for output. When simply sorting, the array of the sorted index entries is associated with the index name. The functions call L<< C|Texinfo::Document/$sorted_indices = $document->sorted_indices_by_letter($customization_information, $use_unicode_collation, $locale_lang) >> or L<< C|Texinfo::Document/$sorted_indices = $document->sorted_indices_by_index($customization_information, $use_unicode_collation, $locale_lang) >> with arguments based on C, C and C customization options, and, if relevant, current C<@documentlanguage>. =back =head2 Conversion to XML Some C methods target conversion to XML. Most methods take a I<$converter> as argument to get some information and use methods for error reporting. =over =item $formatted_text = $converter->xml_format_text_with_numeric_entities($text) X> Replace quotation marks and hyphens used to represent dash in Texinfo text with numeric XML entities. =item $protected_text = $converter->xml_protect_text($text) X> Protect special XML characters (&, E, E, ") of I<$text>. =item $comment = $converter->xml_comment($text) X> Returns an XML comment for I<$text>. =item $result = xml_accent($text, $accent_command, $in_upper_case, $use_numeric_entities) X> I<$text> is the text appearing within an accent command. I<$accent_command> should be a Texinfo tree element corresponding to an accent command taking an argument. I<$in_upper_case> is optional, and, if set, the text is put in upper case. The function returns the accented letter as XML named entity if possible, falling back to numeric entities if there is no named entity and returns the argument as last resort. I<$use_numeric_entities> is optional. If set, numerical entities are used instead of named entities if possible. =item $result = $converter->xml_accents($accent_command, $in_upper_case) X> I<$accent_command> is an accent command, which may have other accent commands nested. If I<$in_upper_case> is set, the result should be upper cased. The function returns the accents formatted as XML. =item $result = xml_numeric_entity_accent($accent_command_name, $text) X> I<$accent_command_name> is the name of an accent command. I<$text> is the text appearing within the accent command. Returns the accented letter as XML numeric entity, or C is there is no such entity. =back =head2 Helper methods The module provides methods that may be useful for converter. Most methods take a I<$converter> as argument to get some information and use methods for error reporting, see L. Also to translate strings, see L. For useful methods that need a converter optionally and can be used in converters that do not inherit from C, see L. =over =item $contents_element = $converter->comma_index_subentries_tree($entry, $separator) X> I<$entry> is a Texinfo tree index entry element. The function sets up an array with the C<@subentry> contents. The result is returned as C in the I<$contents_element> element, or C if there is no such content. I<$separator> is an optional separator argument used, if given, instead of the default: a comma followed by a space. =item $result = $converter->convert_accents($accent_command, \&format_accents, $output_encoded_characters, $in_upper_case) X> I<$accent_command> is an accent command, which may have other accent commands nested. The function returns the accents formatted either as encoded letters if I<$output_encoded_characters> is set, or formatted using I<\&format_accents>. If I<$in_upper_case> is set, the result should be uppercased. =item $succeeded = $converter->create_destination_directory($destination_directory_path, $destination_directory_name) X> Create destination directory I<$destination_directory_path>. I<$destination_directory_path> should be a binary string, while I<$destination_directory_name> should be a character string, that can be used in error messages. I<$succeeded> is true if the creation was successful or uneeded, false otherwise. =item ($output_file, $destination_directory, $output_filename, $document_name, $input_basefile) = $converter->determine_files_and_directory($output_format) X> Determine output file and directory, as well as names related to files. The result depends on the presence of C<@setfilename>, on the Texinfo input file name, and on customization options such as C, C or C, as described in the Texinfo manual. If I<$output_format> is defined and not an empty string, C<_$output_format> is prepended to the default directory name. I<$output_file> is mainly relevant when not split and should be used as the output file name. In general, if not split and I<$output_file> is an empty string, it means that text should be returned by the converter instead of being written to an output file. This is used in the test suite. I<$destination_directory> is either the directory I<$output_file> is in, or if split, the directory where the files should be created. I<$output_filename> is, in general, the file name portion of I<$output_file> (without directory) but can also be set based on C<@setfilename>, in particular when I<$output_file> is an empty string. I<$document_name> is I<$output_filename> without extension. I<$input_basefile> is based on the input Texinfo file name, with the file name portion only (without directory). The strings returned are text strings. =item ($encoded_name, $encoding) = $converter->encoded_input_file_name($character_string_name, $input_file_encoding) =item ($encoded_name, $encoding) = $converter->encoded_output_file_name($character_string_name) X> X> Encode I<$character_string_name> in the same way as other file names are encoded in the converter, based on customization variables, and possibly on the input file encoding. Return the encoded name and the encoding used to encode the name. The C and C functions use different customization variables to determine the encoding. The I<$input_file_encoding> argument is optional. If set, it is used for the input file encoding. It is useful if there is more precise information on the input file encoding where the file name appeared. Note that C is a wrapper around the function with the same name in L<<< C|Texinfo::Convert::Utils/($encoded_name, $encoding) = $converter->encoded_output_file_name($character_string_name) >>>, and C is a wrapper around the function with the same name in L<<< C|Texinfo::Convert::Utils/($encoded_name, $encoding) = $converter->encoded_input_file_name($character_string_name, $input_file_encoding) >>>. =item ($caption, $prepended) = $converter->float_name_caption($float) X> I<$float> is a Texinfo tree C<@float> element. This function returns the caption element that should be used for the float formatting and the I<$prepended> Texinfo tree combining the type and label of the float. =item $tree = $converter->float_type_number($float) X> I<$float> is a Texinfo tree C<@float> element. This function returns the type and number of the float as a Texinfo tree with translations. =item $end_line = $converter->format_comment_or_return_end_line($element) X> Format comment at end of line or return the end of line associated with the element. In many cases, converters ignore comments and output is better formatted with new lines added independently of the presence of newline or comment in the initial Texinfo line, so most converters are better off not using this method. =item $filename = sub $converter->node_information_filename($normalized, $label_element) X> Returns the normalized file name corresponding to the I<$normalized> node name and to the I<$label_element> node name element contents. =item ($normalized_name, $filename) = $converter->normalized_sectioning_command_filename($element) X> Returns a normalized name I<$normalized_name> corresponding to a sectioning command tree element I<$element>, expanding the command argument using transliteration and characters protection. Also returns I<$filename> the corresponding filename based on I<$normalized_name> taking into account additional constraint on file names and adding a file extension. =item $converter->present_bug_message($message, $element) X> Show a bug message using I<$message> text. Use information on I<$element> tree element if given in argument. =item $converter->set_global_document_commands($commands_location, $selected_commands) X> Set the Texinfo customization options for @-commands. I<$selected_commands> is an array reference containing the @-commands set. I<$commands_location> specifies where in the document the value should be taken from. The possibilities are: =over =item before Set to the values before document conversion, from defaults and command-line. =item last Set to the last value for the command. =item preamble Set sequentially to the values in the Texinfo preamble. =item preamble_or_first Set to the first value of the command if the first command is not in the Texinfo preamble, else set as with I, sequentially to the values in the Texinfo preamble. =back Notice that the only effect of this function is to set a customization variable value, no @-command side effects are run, no associated customization variables are set. For more information on the function used to set the value for each of the command, see L C|Texinfo::Common/$element = set_global_document_command($customization_information, $global_commands_information, $cmdname, $command_location)>. =item $table_item_tree = $converter->table_item_content_tree($element) X> I<$element> should be an C<@item> or C<@itemx> tree element. Returns a tree in which the @-command in argument of C<@*table> of the I<$element> has been applied to the I<$element> line argument, or C. =item $result = $converter->top_node_filename($document_name) X> Returns a file name for the Top node file using either C customization value, or C customization value and I<$document_name>. =back Finally, there is: =over =item $result = $converter->output_internal_links() X> At this level, the method just returns undef. It is used in the HTML output, following the C<--internal-links> option of C specification. =back =head1 SEE ALSO L, L, L, L, L and L. =head1 AUTHOR Patrice Dumas, Epertusus@free.frE =head1 COPYRIGHT AND LICENSE Copyright 2011- Free Software Foundation, Inc. See the source file for all copyright years. This library is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. =cut