diff options
author | Randy Dunlap <randy.dunlap@oracle.com> | 2007-02-10 04:46:04 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-02-11 13:51:32 -0500 |
commit | a21217daae8ce6e841e33d4a2bb24026723cb21d (patch) | |
tree | 3d69d0e63944e0e408a025248aff932dfd530906 /scripts | |
parent | 6e8c818829587f001cacae5af4400e4e3aa90a37 (diff) |
[PATCH] kernel-doc: fix some odd spacing issues
- in man and text mode output, if the function return type is empty (like it
is for macros), don't print the return type and a following space; this
fixes an output malalignment;
- in the function short description, strip leading, trailing, and multiple
embedded spaces (to one space); this makes function name/description output
spacing consistent;
- fix a comment typo;
Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/kernel-doc | 24 |
1 files changed, 20 insertions, 4 deletions
diff --git a/scripts/kernel-doc b/scripts/kernel-doc index cc63cd01d5ee..c9b4d3631101 100755 --- a/scripts/kernel-doc +++ b/scripts/kernel-doc | |||
@@ -365,7 +365,7 @@ sub dump_section { | |||
365 | # parameterlist => @list of parameters | 365 | # parameterlist => @list of parameters |
366 | # parameterdescs => %parameter descriptions | 366 | # parameterdescs => %parameter descriptions |
367 | # sectionlist => @list of sections | 367 | # sectionlist => @list of sections |
368 | # sections => %descriont descriptions | 368 | # sections => %section descriptions |
369 | # | 369 | # |
370 | 370 | ||
371 | sub output_highlight { | 371 | sub output_highlight { |
@@ -953,7 +953,11 @@ sub output_function_man(%) { | |||
953 | print $args{'function'}." \\- ".$args{'purpose'}."\n"; | 953 | print $args{'function'}." \\- ".$args{'purpose'}."\n"; |
954 | 954 | ||
955 | print ".SH SYNOPSIS\n"; | 955 | print ".SH SYNOPSIS\n"; |
956 | print ".B \"".$args{'functiontype'}."\" ".$args{'function'}."\n"; | 956 | if ($args{'functiontype'} ne "") { |
957 | print ".B \"".$args{'functiontype'}."\" ".$args{'function'}."\n"; | ||
958 | } else { | ||
959 | print ".B \"".$args{'function'}."\n"; | ||
960 | } | ||
957 | $count = 0; | 961 | $count = 0; |
958 | my $parenth = "("; | 962 | my $parenth = "("; |
959 | my $post = ","; | 963 | my $post = ","; |
@@ -1118,13 +1122,19 @@ sub output_intro_man(%) { | |||
1118 | sub output_function_text(%) { | 1122 | sub output_function_text(%) { |
1119 | my %args = %{$_[0]}; | 1123 | my %args = %{$_[0]}; |
1120 | my ($parameter, $section); | 1124 | my ($parameter, $section); |
1125 | my $start; | ||
1121 | 1126 | ||
1122 | print "Name:\n\n"; | 1127 | print "Name:\n\n"; |
1123 | print $args{'function'}." - ".$args{'purpose'}."\n"; | 1128 | print $args{'function'}." - ".$args{'purpose'}."\n"; |
1124 | 1129 | ||
1125 | print "\nSynopsis:\n\n"; | 1130 | print "\nSynopsis:\n\n"; |
1126 | my $start=$args{'functiontype'}." ".$args{'function'}." ("; | 1131 | if ($args{'functiontype'} ne "") { |
1132 | $start = $args{'functiontype'}." ".$args{'function'}." ("; | ||
1133 | } else { | ||
1134 | $start = $args{'function'}." ("; | ||
1135 | } | ||
1127 | print $start; | 1136 | print $start; |
1137 | |||
1128 | my $count = 0; | 1138 | my $count = 0; |
1129 | foreach my $parameter (@{$args{'parameterlist'}}) { | 1139 | foreach my $parameter (@{$args{'parameterlist'}}) { |
1130 | $type = $args{'parametertypes'}{$parameter}; | 1140 | $type = $args{'parametertypes'}{$parameter}; |
@@ -1710,6 +1720,7 @@ sub process_file($) { | |||
1710 | my $file; | 1720 | my $file; |
1711 | my $identifier; | 1721 | my $identifier; |
1712 | my $func; | 1722 | my $func; |
1723 | my $descr; | ||
1713 | my $initial_section_counter = $section_counter; | 1724 | my $initial_section_counter = $section_counter; |
1714 | 1725 | ||
1715 | if (defined($ENV{'SRCTREE'})) { | 1726 | if (defined($ENV{'SRCTREE'})) { |
@@ -1753,7 +1764,12 @@ sub process_file($) { | |||
1753 | 1764 | ||
1754 | $state = 2; | 1765 | $state = 2; |
1755 | if (/-(.*)/) { | 1766 | if (/-(.*)/) { |
1756 | $declaration_purpose = xml_escape($1); | 1767 | # strip leading/trailing/multiple spaces #RDD:T: |
1768 | $descr= $1; | ||
1769 | $descr =~ s/^\s*//; | ||
1770 | $descr =~ s/\s*$//; | ||
1771 | $descr =~ s/\s+/ /; | ||
1772 | $declaration_purpose = xml_escape($descr); | ||
1757 | } else { | 1773 | } else { |
1758 | $declaration_purpose = ""; | 1774 | $declaration_purpose = ""; |
1759 | } | 1775 | } |