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.
This commit is contained in:
Fred Drake 2002-05-23 17:59:16 +00:00
parent ffb294bd34
commit f547863c63
2 changed files with 106 additions and 102 deletions

View file

@ -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';
$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 {
. " 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 {
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 {
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 {
} }
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 {
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 {
} }
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 {
} }
} }
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 {
$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 {
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 {
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 {
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 {
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 {
# 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 = '';

View file

@ -20,7 +20,7 @@ sub next_argument{
} }
sub next_optional_argument{ sub next_optional_argument{
my($param,$rx) = ('', "^\\s*(\\[([^]]*)\\])?"); my($param, $rx) = ('', "^\\s*(\\[([^]]*)\\])?");
s/$rx/$param=$2;''/eo; s/$rx/$param=$2;''/eo;
return $param; return $param;
} }
@ -150,7 +150,7 @@ sub do_cmd_hackscore{
return '_' . $_; return '_' . $_;
} }
sub use_wrappers{ sub use_wrappers($$$){
local($_,$before,$after) = @_; local($_,$before,$after) = @_;
my $stuff = next_argument(); my $stuff = next_argument();
return $before . $stuff . $after . $_; return $before . $stuff . $after . $_;
@ -297,7 +297,7 @@ sub do_cmd_newsgroup{
sub do_cmd_envvar{ sub do_cmd_envvar{
local($_) = @_; local($_) = @_;
my $envvar = next_argument(); my $envvar = next_argument();
my($name,$aname,$ahref) = new_link_info(); my($name, $aname, $ahref) = new_link_info();
# The <tt> here is really to keep buildindex.py from making # The <tt> here is really to keep buildindex.py from making
# the variable name case-insensitive. # the variable name case-insensitive.
add_index_entry("environment variables!$envvar@<tt>$envvar</tt>", add_index_entry("environment variables!$envvar@<tt>$envvar</tt>",
@ -395,7 +395,7 @@ sub do_cmd_deprecated{
. $_); . $_);
} }
sub versionnote{ sub versionnote($$){
# one or two parameters: \versionnote[explanation]{version} # one or two parameters: \versionnote[explanation]{version}
my $type = @_[0]; my $type = @_[0];
local $_ = @_[1]; local $_ = @_[1];
@ -409,11 +409,11 @@ sub versionnote{
} }
sub do_cmd_versionadded{ sub do_cmd_versionadded{
return versionnote('New', @_); return versionnote('New', @_[0]);
} }
sub do_cmd_versionchanged{ sub do_cmd_versionchanged{
return versionnote('Changed', @_); return versionnote('Changed', @_[0]);
} }
# #
@ -441,7 +441,7 @@ sub do_cmd_ignorePlatformAnnotation{
$INDEX_SUBITEM = ""; $INDEX_SUBITEM = "";
sub get_indexsubitem{ sub get_indexsubitem(){
return $INDEX_SUBITEM ? " $INDEX_SUBITEM" : ''; return $INDEX_SUBITEM ? " $INDEX_SUBITEM" : '';
} }
@ -487,27 +487,27 @@ print INTLABELS "1; # hack in case there are no entries\n\n";
# #
$IDXFILE_FIELD_SEP = "\1"; $IDXFILE_FIELD_SEP = "\1";
sub write_idxfile{ sub write_idxfile($$){
my ($ahref, $str) = @_; my($ahref, $str) = @_;
print IDXFILE $ahref, $IDXFILE_FIELD_SEP, $str, "\n"; print IDXFILE $ahref, $IDXFILE_FIELD_SEP, $str, "\n";
} }
sub gen_link{ sub gen_link($$){
my($node,$target) = @_; my($node, $target) = @_;
print INTLABELS "\$internal_labels{\"$target\"} = \"$URL/$node\";\n"; print INTLABELS "\$internal_labels{\"$target\"} = \"$URL/$node\";\n";
return "<a href=\"$node#$target\">"; return "<a href=\"$node#$target\">";
} }
sub add_index_entry{ sub add_index_entry($$){
# add an entry to the index structures; ignore the return value # add an entry to the index structures; ignore the return value
my($str,$ahref) = @_; my($str, $ahref) = @_;
$str = gen_index_id($str, ''); $str = gen_index_id($str, '');
$index{$str} .= $ahref; $index{$str} .= $ahref;
write_idxfile($ahref, $str); write_idxfile($ahref, $str);
} }
sub new_link_info{ sub new_link_info(){
my $name = "l2h-" . ++$globals{'max_id'}; my $name = "l2h-" . ++$globals{'max_id'};
my $aname = "<a name=\"$name\">"; my $aname = "<a name=\"$name\">";
my $ahref = gen_link($CURRENT_FILE, $name); my $ahref = gen_link($CURRENT_FILE, $name);
@ -515,7 +515,7 @@ sub new_link_info{
} }
$IndexMacroPattern = ''; $IndexMacroPattern = '';
sub define_indexing_macro{ sub define_indexing_macro(@){
my $count = @_; my $count = @_;
my $i = 0; my $i = 0;
for (; $i < $count; ++$i) { for (; $i < $count; ++$i) {
@ -535,11 +535,11 @@ sub define_indexing_macro{
} }
$DEBUG_INDEXING = 0; $DEBUG_INDEXING = 0;
sub process_index_macros{ sub process_index_macros($$){
local($_) = @_; local($_) = @_;
my $cmdname = @_[1]; # This is what triggered us in the first place; my $cmdname = @_[1]; # This is what triggered us in the first place;
# we know it's real, so just process it. # we know it's real, so just process it.
my($name,$aname,$ahref) = new_link_info(); my($name, $aname, $ahref) = new_link_info();
my $cmd = "idx_cmd_$cmdname"; my $cmd = "idx_cmd_$cmdname";
print "\nIndexing: \\$cmdname" print "\nIndexing: \\$cmdname"
if $DEBUG_INDEXING; if $DEBUG_INDEXING;
@ -564,20 +564,20 @@ sub process_index_macros{
} }
define_indexing_macro('index'); define_indexing_macro('index');
sub idx_cmd_index{ sub idx_cmd_index($){
my $str = next_argument(); my $str = next_argument();
add_index_entry("$str", @_[0]); add_index_entry("$str", @_[0]);
} }
define_indexing_macro('kwindex'); define_indexing_macro('kwindex');
sub idx_cmd_kwindex{ sub idx_cmd_kwindex($){
my $str = next_argument(); my $str = next_argument();
add_index_entry("<tt>$str</tt>!keyword", @_[0]); add_index_entry("<tt>$str</tt>!keyword", @_[0]);
add_index_entry("keyword!<tt>$str</tt>", @_[0]); add_index_entry("keyword!<tt>$str</tt>", @_[0]);
} }
define_indexing_macro('indexii'); define_indexing_macro('indexii');
sub idx_cmd_indexii{ sub idx_cmd_indexii($){
my $str1 = next_argument(); my $str1 = next_argument();
my $str2 = next_argument(); my $str2 = next_argument();
add_index_entry("$str1!$str2", @_[0]); add_index_entry("$str1!$str2", @_[0]);
@ -585,7 +585,7 @@ sub idx_cmd_indexii{
} }
define_indexing_macro('indexiii'); define_indexing_macro('indexiii');
sub idx_cmd_indexiii{ sub idx_cmd_indexiii($){
my $str1 = next_argument(); my $str1 = next_argument();
my $str2 = next_argument(); my $str2 = next_argument();
my $str3 = next_argument(); my $str3 = next_argument();
@ -595,7 +595,7 @@ sub idx_cmd_indexiii{
} }
define_indexing_macro('indexiv'); define_indexing_macro('indexiv');
sub idx_cmd_indexiv{ sub idx_cmd_indexiv($){
my $str1 = next_argument(); my $str1 = next_argument();
my $str2 = next_argument(); my $str2 = next_argument();
my $str3 = next_argument(); my $str3 = next_argument();
@ -607,36 +607,36 @@ sub idx_cmd_indexiv{
} }
define_indexing_macro('ttindex'); define_indexing_macro('ttindex');
sub idx_cmd_ttindex{ sub idx_cmd_ttindex($){
my $str = next_argument(); my $str = next_argument();
my $entry = $str . get_indexsubitem(); my $entry = $str . get_indexsubitem();
add_index_entry($entry, @_[0]); add_index_entry($entry, @_[0]);
} }
sub my_typed_index_helper{ sub my_typed_index_helper($$){
my($word,$ahref) = @_; my($word, $ahref) = @_;
my $str = next_argument(); my $str = next_argument();
add_index_entry("$str $word", $ahref); add_index_entry("$str $word", $ahref);
add_index_entry("$word!$str", $ahref); add_index_entry("$word!$str", $ahref);
} }
define_indexing_macro('stindex', 'opindex', 'exindex', 'obindex'); define_indexing_macro('stindex', 'opindex', 'exindex', 'obindex');
sub idx_cmd_stindex{ my_typed_index_helper('statement', @_[0]); } sub idx_cmd_stindex($){ my_typed_index_helper('statement', @_[0]); }
sub idx_cmd_opindex{ my_typed_index_helper('operator', @_[0]); } sub idx_cmd_opindex($){ my_typed_index_helper('operator', @_[0]); }
sub idx_cmd_exindex{ my_typed_index_helper('exception', @_[0]); } sub idx_cmd_exindex($){ my_typed_index_helper('exception', @_[0]); }
sub idx_cmd_obindex{ my_typed_index_helper('object', @_[0]); } sub idx_cmd_obindex($){ my_typed_index_helper('object', @_[0]); }
define_indexing_macro('bifuncindex'); define_indexing_macro('bifuncindex');
sub idx_cmd_bifuncindex{ sub idx_cmd_bifuncindex($){
my $str = next_argument(); my $str = next_argument();
add_index_entry("<tt class=\"function\">$str()</tt> (built-in function)", add_index_entry("<tt class=\"function\">$str()</tt> (built-in function)",
@_[0]); @_[0]);
} }
sub make_mod_index_entry{ sub make_mod_index_entry($$){
my($str,$define) = @_; my($str, $define) = @_;
my($name,$aname,$ahref) = new_link_info(); my($name, $aname, $ahref) = new_link_info();
# equivalent of add_index_entry() using $define instead of '' # equivalent of add_index_entry() using $define instead of ''
$ahref =~ s/\#[-_a-zA-Z0-9]*\"/\"/ $ahref =~ s/\#[-_a-zA-Z0-9]*\"/\"/
if ($define eq 'DEF'); if ($define eq 'DEF');
@ -657,8 +657,8 @@ sub make_mod_index_entry{
$THIS_MODULE = ''; $THIS_MODULE = '';
$THIS_CLASS = ''; $THIS_CLASS = '';
sub define_module{ sub define_module($$){
my($word,$name) = @_; my($word, $name) = @_;
my $section_tag = join('', @curr_sec_id); my $section_tag = join('', @curr_sec_id);
if ($word ne "built-in" && $word ne "extension" if ($word ne "built-in" && $word ne "extension"
&& $word ne "standard" && $word ne "") { && $word ne "standard" && $word ne "") {
@ -674,7 +674,7 @@ sub define_module{
"<tt class=\"module\">$name</tt> (${word}module)", 'DEF'); "<tt class=\"module\">$name</tt> (${word}module)", 'DEF');
} }
sub my_module_index_helper{ sub my_module_index_helper($$){
local($word, $_) = @_; local($word, $_) = @_;
my $name = next_argument(); my $name = next_argument();
return define_module($word, $name) . $_; return define_module($word, $name) . $_;
@ -685,7 +685,7 @@ sub do_cmd_bimodindex{ return my_module_index_helper('built-in', @_); }
sub do_cmd_exmodindex{ return my_module_index_helper('extension', @_); } sub do_cmd_exmodindex{ return my_module_index_helper('extension', @_); }
sub do_cmd_stmodindex{ return my_module_index_helper('standard', @_); } sub do_cmd_stmodindex{ return my_module_index_helper('standard', @_); }
sub ref_module_index_helper{ sub ref_module_index_helper($$){
my($word, $ahref) = @_; my($word, $ahref) = @_;
my $str = next_argument(); my $str = next_argument();
$word = "$word " if $word; $word = "$word " if $word;
@ -700,14 +700,14 @@ sub ref_module_index_helper{
# these should be adjusted a bit.... # these should be adjusted a bit....
define_indexing_macro('refmodindex', 'refbimodindex', define_indexing_macro('refmodindex', 'refbimodindex',
'refexmodindex', 'refstmodindex'); 'refexmodindex', 'refstmodindex');
sub idx_cmd_refmodindex{ return ref_module_index_helper('', @_); } sub idx_cmd_refmodindex($){ return ref_module_index_helper('', @_); }
sub idx_cmd_refbimodindex{ return ref_module_index_helper('built-in', @_); } sub idx_cmd_refbimodindex($){ return ref_module_index_helper('built-in', @_); }
sub idx_cmd_refexmodindex{ return ref_module_index_helper('extension', @_); } sub idx_cmd_refexmodindex($){ return ref_module_index_helper('extension', @_);}
sub idx_cmd_refstmodindex{ return ref_module_index_helper('standard', @_); } sub idx_cmd_refstmodindex($){ return ref_module_index_helper('standard', @_); }
sub do_cmd_nodename{ return do_cmd_label(@_); } sub do_cmd_nodename{ return do_cmd_label(@_); }
sub init_myformat{ sub init_myformat(){
$anchor_invisible_mark = '&nbsp;'; $anchor_invisible_mark = '&nbsp;';
$anchor_invisible_mark2 = ''; $anchor_invisible_mark2 = '';
$anchor_mark = ''; $anchor_mark = '';
@ -718,9 +718,9 @@ init_myformat();
# Create an index entry, but include the string in the target anchor # Create an index entry, but include the string in the target anchor
# instead of the dummy filler. # instead of the dummy filler.
# #
sub make_str_index_entry{ sub make_str_index_entry($){
my($str) = @_; my $str = @_[0];
my($name,$aname,$ahref) = new_link_info(); my($name, $aname, $ahref) = new_link_info();
add_index_entry($str, $ahref); add_index_entry($str, $ahref);
return "$aname$str</a>"; return "$aname$str</a>";
} }
@ -819,7 +819,7 @@ sub do_cmd_productioncont{
. $_); . $_);
} }
sub process_grammar_files{ sub process_grammar_files(){
my $lang; my $lang;
my $filename; my $filename;
local($_); local($_);
@ -857,7 +857,7 @@ sub process_grammar_files{
} }
} }
sub strip_grammar_markup{ sub strip_grammar_markup($){
local($_) = @_; local($_) = @_;
s/\\productioncont/ /g; s/\\productioncont/ /g;
s/\\production(<<\d+>>)(.+)\1/\n\2 ::= /g; s/\\production(<<\d+>>)(.+)\1/\n\2 ::= /g;
@ -873,7 +873,7 @@ sub strip_grammar_markup{
$REFCOUNTS_LOADED = 0; $REFCOUNTS_LOADED = 0;
sub load_refcounts{ sub load_refcounts(){
$REFCOUNTS_LOADED = 1; $REFCOUNTS_LOADED = 1;
my $myname, $mydir, $myext; my $myname, $mydir, $myext;
@ -896,8 +896,8 @@ sub load_refcounts{
} }
} }
sub get_refcount{ sub get_refcount($$){
my ($func, $param) = @_; my($func, $param) = @_;
load_refcounts() load_refcounts()
unless $REFCOUNTS_LOADED; unless $REFCOUNTS_LOADED;
return $REFCOUNTS{"$func:$param"}; return $REFCOUNTS{"$func:$param"};
@ -907,8 +907,8 @@ sub get_refcount{
$TLSTART = '<span class="typelabel">'; $TLSTART = '<span class="typelabel">';
$TLEND = '</span>'; $TLEND = '</span>';
sub cfuncline_helper{ sub cfuncline_helper($$$){
my ($type, $name, $args) = @_; my($type, $name, $args) = @_;
my $idx = make_str_index_entry( my $idx = make_str_index_entry(
"<tt class=\"cfunction\">$name()</tt>" . get_indexsubitem()); "<tt class=\"cfunction\">$name()</tt>" . get_indexsubitem());
$idx =~ s/ \(.*\)//; $idx =~ s/ \(.*\)//;
@ -991,7 +991,7 @@ sub do_env_ctypedesc{
my $type_name = next_argument(); my $type_name = next_argument();
$index_name = $type_name $index_name = $type_name
unless $index_name; unless $index_name;
my($name,$aname,$ahref) = new_link_info(); my($name, $aname, $ahref) = new_link_info();
add_index_entry("<tt class=\"ctype\">$index_name</tt> (C type)", $ahref); add_index_entry("<tt class=\"ctype\">$index_name</tt> (C type)", $ahref);
return "<dl><dt><b><tt class=\"ctype\">$aname$type_name</a></tt></b>\n<dd>" return "<dl><dt><b><tt class=\"ctype\">$aname$type_name</a></tt></b>\n<dd>"
. $_ . $_
@ -1132,7 +1132,7 @@ sub do_env_excdesc{
sub do_env_fulllineitems{ return do_env_itemize(@_); } sub do_env_fulllineitems{ return do_env_itemize(@_); }
sub handle_classlike_descriptor{ sub handle_classlike_descriptor($$){
local($_, $what) = @_; local($_, $what) = @_;
$THIS_CLASS = next_argument(); $THIS_CLASS = next_argument();
my $arg_list = convert_args(next_argument()); my $arg_list = convert_args(next_argument());
@ -1290,7 +1290,7 @@ sub do_cmd_memberlineni{
'textrm' => '', 'textrm' => '',
); );
sub fix_font{ sub fix_font($){
# do a little magic on a font name to get the right behavior in the first # do a little magic on a font name to get the right behavior in the first
# column of the output table # column of the output table
my $font = @_[0]; my $font = @_[0];
@ -1300,7 +1300,7 @@ sub fix_font{
return $font; return $font;
} }
sub figure_column_alignment{ sub figure_column_alignment($){
my $a = @_[0]; my $a = @_[0];
my $mark = substr($a, 0, 1); my $mark = substr($a, 0, 1);
my $r = ''; my $r = '';
@ -1315,9 +1315,9 @@ sub figure_column_alignment{
return $r; return $r;
} }
sub setup_column_alignments{ sub setup_column_alignments($){
local($_) = @_; local($_) = @_;
my($s1,$s2,$s3,$s4,$a5) = split(/[|]/,$_); my($s1, $s2, $s3, $s4, $a5) = split(/[|]/,$_);
my $a1 = figure_column_alignment($s1); my $a1 = figure_column_alignment($s1);
my $a2 = figure_column_alignment($s2); my $a2 = figure_column_alignment($s2);
my $a3 = figure_column_alignment($s3); my $a3 = figure_column_alignment($s3);
@ -1332,9 +1332,9 @@ sub setup_column_alignments{
return ("<th$a1>", "<th$a2>", "<th$a3>", "<th$a4>", "<th$a5>"); return ("<th$a1>", "<th$a2>", "<th$a3>", "<th$a4>", "<th$a5>");
} }
sub get_table_col1_fonts{ sub get_table_col1_fonts(){
my $font = $globals{'lineifont'}; my $font = $globals{'lineifont'};
my ($sfont,$efont) = ('', ''); my($sfont, $efont) = ('', '');
if ($font) { if ($font) {
$sfont = "<$font>"; $sfont = "<$font>";
$efont = "</$font>"; $efont = "</$font>";
@ -1345,7 +1345,8 @@ sub get_table_col1_fonts{
sub do_env_tableii{ sub do_env_tableii{
local($_) = @_; local($_) = @_;
my($th1,$th2,$th3,$th4,$th5) = setup_column_alignments(next_argument()); my $arg = next_argument();
my($th1, $th2, $th3, $th4, $th5) = setup_column_alignments($arg);
my $font = fix_font(next_argument()); my $font = fix_font(next_argument());
my $h1 = next_argument(); my $h1 = next_argument();
my $h2 = next_argument(); my $h2 = next_argument();
@ -1377,9 +1378,9 @@ sub do_cmd_lineii{
my $c1 = next_argument(); my $c1 = next_argument();
my $c2 = next_argument(); my $c2 = next_argument();
s/[\s\n]+//; s/[\s\n]+//;
my($sfont,$efont) = get_table_col1_fonts(); my($sfont, $efont) = get_table_col1_fonts();
$c2 = '&nbsp;' if ($c2 eq ''); $c2 = '&nbsp;' if ($c2 eq '');
my($c1align,$c2align) = split('\|', $aligns); my($c1align, $c2align) = split('\|', $aligns);
my $padding = ''; my $padding = '';
if ($c1align =~ /align="right"/ || $c1 eq '') { if ($c1align =~ /align="right"/ || $c1 eq '') {
$padding = '&nbsp;'; $padding = '&nbsp;';
@ -1391,7 +1392,8 @@ sub do_cmd_lineii{
sub do_env_tableiii{ sub do_env_tableiii{
local($_) = @_; local($_) = @_;
my($th1,$th2,$th3,$th4,$th5) = setup_column_alignments(next_argument()); my $arg = next_argument();
my($th1, $th2, $th3, $th4, $th5) = setup_column_alignments($arg);
my $font = fix_font(next_argument()); my $font = fix_font(next_argument());
my $h1 = next_argument(); my $h1 = next_argument();
my $h2 = next_argument(); my $h2 = next_argument();
@ -1427,9 +1429,9 @@ sub do_cmd_lineiii{
my $c2 = next_argument(); my $c2 = next_argument();
my $c3 = next_argument(); my $c3 = next_argument();
s/[\s\n]+//; s/[\s\n]+//;
my($sfont,$efont) = get_table_col1_fonts(); my($sfont, $efont) = get_table_col1_fonts();
$c3 = '&nbsp;' if ($c3 eq ''); $c3 = '&nbsp;' if ($c3 eq '');
my($c1align,$c2align,$c3align) = split('\|', $aligns); my($c1align, $c2align, $c3align) = split('\|', $aligns);
my $padding = ''; my $padding = '';
if ($c1align =~ /align="right"/ || $c1 eq '') { if ($c1align =~ /align="right"/ || $c1 eq '') {
$padding = '&nbsp;'; $padding = '&nbsp;';
@ -1442,7 +1444,8 @@ sub do_cmd_lineiii{
sub do_env_tableiv{ sub do_env_tableiv{
local($_) = @_; local($_) = @_;
my($th1,$th2,$th3,$th4,$th5) = setup_column_alignments(next_argument()); my $arg = next_argument();
my($th1, $th2, $th3, $th4, $th5) = setup_column_alignments($arg);
my $font = fix_font(next_argument()); my $font = fix_font(next_argument());
my $h1 = next_argument(); my $h1 = next_argument();
my $h2 = next_argument(); my $h2 = next_argument();
@ -1482,9 +1485,9 @@ sub do_cmd_lineiv{
my $c3 = next_argument(); my $c3 = next_argument();
my $c4 = next_argument(); my $c4 = next_argument();
s/[\s\n]+//; s/[\s\n]+//;
my($sfont,$efont) = get_table_col1_fonts(); my($sfont, $efont) = get_table_col1_fonts();
$c4 = '&nbsp;' if ($c4 eq ''); $c4 = '&nbsp;' if ($c4 eq '');
my($c1align,$c2align,$c3align,$c4align) = split('\|', $aligns); my($c1align, $c2align, $c3align, $c4align) = split('\|', $aligns);
my $padding = ''; my $padding = '';
if ($c1align =~ /align="right"/ || $c1 eq '') { if ($c1align =~ /align="right"/ || $c1 eq '') {
$padding = '&nbsp;'; $padding = '&nbsp;';
@ -1498,7 +1501,8 @@ sub do_cmd_lineiv{
sub do_env_tablev{ sub do_env_tablev{
local($_) = @_; local($_) = @_;
my($th1,$th2,$th3,$th4,$th5) = setup_column_alignments(next_argument()); my $arg = next_argument();
my($th1, $th2, $th3, $th4, $th5) = setup_column_alignments($arg);
my $font = fix_font(next_argument()); my $font = fix_font(next_argument());
my $h1 = next_argument(); my $h1 = next_argument();
my $h2 = next_argument(); my $h2 = next_argument();
@ -1542,9 +1546,9 @@ sub do_cmd_linev{
my $c4 = next_argument(); my $c4 = next_argument();
my $c5 = next_argument(); my $c5 = next_argument();
s/[\s\n]+//; s/[\s\n]+//;
my($sfont,$efont) = get_table_col1_fonts(); my($sfont, $efont) = get_table_col1_fonts();
$c5 = '&nbsp;' if ($c5 eq ''); $c5 = '&nbsp;' if ($c5 eq '');
my($c1align,$c2align,$c3align,$c4align,$c5align) = split('\|', $aligns); my($c1align, $c2align, $c3align, $c4align, $c5align) = split('\|',$aligns);
my $padding = ''; my $padding = '';
if ($c1align =~ /align="right"/ || $c1 eq '') { if ($c1align =~ /align="right"/ || $c1 eq '') {
$padding = '&nbsp;'; $padding = '&nbsp;';
@ -1576,7 +1580,7 @@ sub do_cmd_linev{
# $TITLE_PAGE_GRAPHIC_HEIGHT = 150; # $TITLE_PAGE_GRAPHIC_HEIGHT = 150;
# $TITLE_PAGE_GRAPHIC_ON_RIGHT = 0; # $TITLE_PAGE_GRAPHIC_ON_RIGHT = 0;
sub make_my_titlepage() { sub make_my_titlepage(){
my $the_title = ""; my $the_title = "";
if ($t_title) { if ($t_title) {
$the_title .= "\n<h1>$t_title</h1>"; $the_title .= "\n<h1>$t_title</h1>";
@ -1629,7 +1633,7 @@ sub make_my_titlepage() {
return $the_title; return $the_title;
} }
sub make_my_titlegraphic() { sub make_my_titlegraphic(){
my $filename = make_icon_filename($TITLE_PAGE_GRAPHIC); my $filename = make_icon_filename($TITLE_PAGE_GRAPHIC);
my $graphic = "<td class=\"titlegraphic\""; my $graphic = "<td class=\"titlegraphic\"";
$graphic .= " width=\"$TITLE_PAGE_GRAPHIC_COLWIDTH\"" $graphic .= " width=\"$TITLE_PAGE_GRAPHIC_COLWIDTH\""
@ -1643,7 +1647,7 @@ sub make_my_titlegraphic() {
return $graphic; return $graphic;
} }
sub do_cmd_maketitle { sub do_cmd_maketitle{
local($_) = @_; local($_) = @_;
my $the_title = "\n<div class=\"titlepage\">"; my $the_title = "\n<div class=\"titlepage\">";
if ($TITLE_PAGE_GRAPHIC) { if ($TITLE_PAGE_GRAPHIC) {
@ -1692,7 +1696,7 @@ sub get_chapter_id(){
%ModuleSynopses = (); %ModuleSynopses = ();
sub get_synopsis_table($){ sub get_synopsis_table($){
my($chap) = @_; my $chap = @_[0];
my $key; my $key;
foreach $key (keys %ModuleSynopses) { foreach $key (keys %ModuleSynopses) {
if ($key eq $chap) { if ($key eq $chap) {
@ -1747,7 +1751,7 @@ sub do_cmd_localmoduletable{
return "<tex2html-localmoduletable><$chap>\\tableofchildlinks[off]" . $_; return "<tex2html-localmoduletable><$chap>\\tableofchildlinks[off]" . $_;
} }
sub process_all_localmoduletables{ sub process_all_localmoduletables(){
my $key; my $key;
my $st, $file; my $st, $file;
foreach $key (keys %ModuleSynopses) { foreach $key (keys %ModuleSynopses) {
@ -1762,7 +1766,7 @@ sub process_all_localmoduletables{
} }
} }
sub process_localmoduletables_in_file{ sub process_localmoduletables_in_file($){
my $file = @_[0]; my $file = @_[0];
open(MYFILE, "<$file"); open(MYFILE, "<$file");
local($_); local($_);
@ -1780,7 +1784,7 @@ sub process_localmoduletables_in_file{
print MYFILE $_; print MYFILE $_;
close(MYFILE); close(MYFILE);
} }
sub process_python_state{ sub process_python_state(){
process_all_localmoduletables(); process_all_localmoduletables();
process_grammar_files(); process_grammar_files();
} }
@ -1831,7 +1835,7 @@ sub strip_html_markup($){
return $s; return $s;
} }
sub handle_rfclike_reference{ sub handle_rfclike_reference($$$){
local($_, $what, $format) = @_; local($_, $what, $format) = @_;
my $rfcnum = next_argument(); my $rfcnum = next_argument();
my $title = next_argument(); my $title = next_argument();
@ -1905,7 +1909,7 @@ sub do_env_definitions{
sub do_cmd_term{ sub do_cmd_term{
local($_) = @_; local($_) = @_;
my $term = next_argument(); my $term = next_argument();
my($name,$aname,$ahref) = new_link_info(); my($name, $aname, $ahref) = new_link_info();
# could easily add an index entry here... # could easily add an index entry here...
return "<dt><b>$aname" . $term . "</a></b>\n<dd>" . $_; return "<dt><b>$aname" . $term . "</a></b>\n<dd>" . $_;
} }
@ -1931,7 +1935,7 @@ _RAW_ARG_DEFERRED_CMDS_
$alltt_start = '<div class="verbatim"><pre>'; $alltt_start = '<div class="verbatim"><pre>';
$alltt_end = '</pre></div>'; $alltt_end = '</pre></div>';
sub do_env_alltt { sub do_env_alltt{
local ($_) = @_; local ($_) = @_;
local($closures,$reopens,@open_block_tags); local($closures,$reopens,@open_block_tags);