Kaydet (Commit) f547863c authored tarafından Fred Drake's avatar Fred Drake

Use Perl function prototypes to help avoid definition/usage mismatches

while modifying these files.
Minor style changes to make the use of "my" with arrays more consistent.
üst ffb294bd
...@@ -99,8 +99,8 @@ sub custom_driver_hook { ...@@ -99,8 +99,8 @@ sub custom_driver_hook {
$CUSTOM_BUTTONS = ''; $CUSTOM_BUTTONS = '';
sub make_nav_sectref { sub make_nav_sectref($$) {
my($label,$title) = @_; my($label, $title) = @_;
if ($title) { if ($title) {
if ($title =~ /\<[aA] /) { if ($title =~ /\<[aA] /) {
$title =~ s/\<[aA] /<a class="sectref" /; $title =~ s/\<[aA] /<a class="sectref" /;
...@@ -127,7 +127,7 @@ $my_icon_tags{'modules'} = 'Module Index'; ...@@ -127,7 +127,7 @@ $my_icon_tags{'modules'} = 'Module Index';
$my_icon_names{'previous_page'} = 'previous'; $my_icon_names{'previous_page'} = 'previous';
$my_icon_names{'next_page'} = 'next'; $my_icon_names{'next_page'} = 'next';
sub get_my_icon { sub get_my_icon($) {
my $name = @_[0]; my $name = @_[0];
my $text = $my_icon_tags{$name}; my $text = $my_icon_tags{$name};
if ($my_icon_names{$name}) { if ($my_icon_names{$name}) {
...@@ -141,7 +141,7 @@ sub get_my_icon { ...@@ -141,7 +141,7 @@ sub get_my_icon {
. " height=\"32\"\n alt=\"$text\" width=\"32\">"; . " height=\"32\"\n alt=\"$text\" width=\"32\">";
} }
sub use_my_icon { sub use_my_icon($) {
my $s = @_[0]; my $s = @_[0];
if ($s =~ /\<tex2html_([a-z_]+)_visible_mark\>/) { if ($s =~ /\<tex2html_([a-z_]+)_visible_mark\>/) {
my $r = get_my_icon($1); my $r = get_my_icon($1);
...@@ -150,7 +150,7 @@ sub use_my_icon { ...@@ -150,7 +150,7 @@ sub use_my_icon {
return $s; return $s;
} }
sub make_nav_panel { sub make_nav_panel() {
my $s; my $s;
my $BLANK_ICON = get_my_icon('blank'); my $BLANK_ICON = get_my_icon('blank');
$NEXT = $NEXT_TITLE ? use_my_icon("$NEXT") : $BLANK_ICON; $NEXT = $NEXT_TITLE ? use_my_icon("$NEXT") : $BLANK_ICON;
...@@ -192,7 +192,7 @@ sub add_child_links { ...@@ -192,7 +192,7 @@ sub add_child_links {
return $toc; return $toc;
} }
sub get_version_text { sub get_version_text() {
if ($PACKAGE_VERSION ne '' && $t_date) { if ($PACKAGE_VERSION ne '' && $t_date) {
return ("<span class=\"release-info\">" return ("<span class=\"release-info\">"
. "Release $PACKAGE_VERSION$RELEASE_INFO," . "Release $PACKAGE_VERSION$RELEASE_INFO,"
...@@ -210,13 +210,13 @@ sub get_version_text { ...@@ -210,13 +210,13 @@ sub get_version_text {
} }
sub top_navigation_panel { sub top_navigation_panel() {
return "\n" return "\n"
. make_nav_panel() . make_nav_panel()
. "<br><hr>\n"; . "<br><hr>\n";
} }
sub bot_navigation_panel { sub bot_navigation_panel() {
return "\n<p><hr>\n" return "\n<p><hr>\n"
. make_nav_panel() . make_nav_panel()
. "<hr>\n" . "<hr>\n"
...@@ -255,7 +255,7 @@ sub add_link { ...@@ -255,7 +255,7 @@ sub add_link {
return (&inactive_img($icon), ""); return (&inactive_img($icon), "");
} }
sub add_special_link { sub add_special_link($$$) {
my($icon, $file, $current_file) = @_; my($icon, $file, $current_file) = @_;
if ($icon =~ /\<tex2html_([_a-z]+)_visible_mark\>/) { if ($icon =~ /\<tex2html_([_a-z]+)_visible_mark\>/) {
my $r = get_my_icon($1); my $r = get_my_icon($1);
...@@ -281,14 +281,14 @@ sub do_cmd_arabic { ...@@ -281,14 +281,14 @@ sub do_cmd_arabic {
} }
sub gen_index_id { sub gen_index_id($$) {
# this is used to ensure common index key generation and a stable sort # this is used to ensure common index key generation and a stable sort
my($str,$extra) = @_; my($str, $extra) = @_;
sprintf('%s###%s%010d', $str, $extra, ++$global{'max_id'}); sprintf('%s###%s%010d', $str, $extra, ++$global{'max_id'});
} }
sub insert_index { sub insert_index($$$$$) {
my($mark,$datafile,$columns,$letters,$prefix) = @_; my($mark, $datafile, $columns, $letters, $prefix) = @_;
my $prog = "$myrootdir/tools/buildindex.py"; my $prog = "$myrootdir/tools/buildindex.py";
my $index; my $index;
if ($letters) { if ($letters) {
...@@ -302,7 +302,7 @@ sub insert_index { ...@@ -302,7 +302,7 @@ sub insert_index {
} }
} }
sub add_idx { sub add_idx() {
print "\nBuilding HTML for the index ..."; print "\nBuilding HTML for the index ...";
close(IDXFILE); close(IDXFILE);
insert_index($idx_mark, 'index.dat', $INDEX_COLUMNS, 1, ''); insert_index($idx_mark, 'index.dat', $INDEX_COLUMNS, 1, '');
...@@ -312,7 +312,7 @@ sub add_idx { ...@@ -312,7 +312,7 @@ sub add_idx {
$idx_module_mark = '<tex2html_idx_module_mark>'; $idx_module_mark = '<tex2html_idx_module_mark>';
$idx_module_title = 'Module Index'; $idx_module_title = 'Module Index';
sub add_module_idx { sub add_module_idx() {
print "\nBuilding HTML for the module index ..."; print "\nBuilding HTML for the module index ...";
my $key; my $key;
my $first = 1; my $first = 1;
...@@ -391,7 +391,7 @@ sub do_cmd_tableofcontents { ...@@ -391,7 +391,7 @@ sub do_cmd_tableofcontents {
local($_) = @_; local($_) = @_;
$TITLE = $toc_title; $TITLE = $toc_title;
$tocfile = $CURRENT_FILE; $tocfile = $CURRENT_FILE;
my($closures,$reopens) = preserve_open_tags(); my($closures, $reopens) = preserve_open_tags();
anchor_label('contents', $CURRENT_FILE, $_); # this is added anchor_label('contents', $CURRENT_FILE, $_); # this is added
join('', "<BR>\n\\tableofchildlinks[off]", $closures join('', "<BR>\n\\tableofchildlinks[off]", $closures
, make_section_heading($toc_title, 'H2'), $toc_mark , make_section_heading($toc_title, 'H2'), $toc_mark
...@@ -402,7 +402,7 @@ sub do_cmd_listoffigures { ...@@ -402,7 +402,7 @@ sub do_cmd_listoffigures {
local($_) = @_; local($_) = @_;
$TITLE = $lof_title; $TITLE = $lof_title;
$loffile = $CURRENT_FILE; $loffile = $CURRENT_FILE;
my($closures,$reopens) = preserve_open_tags(); my($closures, $reopens) = preserve_open_tags();
anchor_label('lof', $CURRENT_FILE, $_); # this is added anchor_label('lof', $CURRENT_FILE, $_); # this is added
join('', "<BR>\n", $closures join('', "<BR>\n", $closures
, make_section_heading($lof_title, 'H2'), $lof_mark , make_section_heading($lof_title, 'H2'), $lof_mark
...@@ -413,7 +413,7 @@ sub do_cmd_listoftables { ...@@ -413,7 +413,7 @@ sub do_cmd_listoftables {
local($_) = @_; local($_) = @_;
$TITLE = $lot_title; $TITLE = $lot_title;
$lotfile = $CURRENT_FILE; $lotfile = $CURRENT_FILE;
my($closures,$reopens) = preserve_open_tags(); my($closures, $reopens) = preserve_open_tags();
anchor_label('lot', $CURRENT_FILE, $_); # this is added anchor_label('lot', $CURRENT_FILE, $_); # this is added
join('', "<BR>\n", $closures join('', "<BR>\n", $closures
, make_section_heading($lot_title, 'H2'), $lot_mark , make_section_heading($lot_title, 'H2'), $lot_mark
...@@ -455,7 +455,7 @@ sub do_cmd_textohtmlindex { ...@@ -455,7 +455,7 @@ sub do_cmd_textohtmlindex {
if (($SHORT_INDEX) && (%index_segment)) { make_preindex(); } if (($SHORT_INDEX) && (%index_segment)) { make_preindex(); }
else { $preindex = ''; } else { $preindex = ''; }
my $heading = make_section_heading($idx_title, 'h2') . $idx_mark; my $heading = make_section_heading($idx_title, 'h2') . $idx_mark;
my($pre,$post) = minimize_open_tags($heading); my($pre, $post) = minimize_open_tags($heading);
anchor_label('genindex',$CURRENT_FILE,$_); # this is added anchor_label('genindex',$CURRENT_FILE,$_); # this is added
return "<br>\n" . $pre . $_; return "<br>\n" . $pre . $_;
} }
...@@ -585,7 +585,7 @@ sub set_depth_levels { ...@@ -585,7 +585,7 @@ sub set_depth_levels {
# doctype declaration; MSIE5 on NT4 SP4 barfs on it and drops the # doctype declaration; MSIE5 on NT4 SP4 barfs on it and drops the
# content of the page. # content of the page.
$MY_PARTIAL_HEADER = ''; $MY_PARTIAL_HEADER = '';
sub make_head_and_body { sub make_head_and_body($$) {
my($title, $body) = @_; my($title, $body) = @_;
$body = " $body" unless ($body eq ''); $body = " $body" unless ($body eq '');
my $DTDcomment = ''; my $DTDcomment = '';
......
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment