From: Randy.Dunlap Date: Sat, 1 Jul 2006 11:36:34 +0000 (-0700) Subject: [PATCH] kernel-doc: consistent text/man mode output X-Git-Tag: v2.6.18-rc1~197 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1d7e1d4517f11ebeb80f92e227c8fdbc3215385c;p=linux-2.6 [PATCH] kernel-doc: consistent text/man mode output Add a space between data type and struct field name in man-mode bitfield struct output so that they don't run together. For text-mode struct output, print the struct 'purpose' or short description (as done in man-mode output). For text-mode enum output, print the enum 'purpose' or short description (as done in man-mode output). For text-mode typedef output, print the typedef 'purpose' or short description (as done in man-mode output). Signed-off-by: Randy Dunlap Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/scripts/kernel-doc b/scripts/kernel-doc index 00e21297ae..0514e2505f 100755 --- a/scripts/kernel-doc +++ b/scripts/kernel-doc @@ -1056,7 +1056,8 @@ sub output_struct_man(%) { # pointer-to-function print ".BI \" ".$1."\" ".$parameter." \") (".$2.")"."\"\n;\n"; } elsif ($type =~ m/^(.*?)\s*(:.*)/) { - print ".BI \" ".$1."\" ".$parameter.$2." \""."\"\n;\n"; + # bitfield + print ".BI \" ".$1."\ \" ".$parameter.$2." \""."\"\n;\n"; } else { $type =~ s/([^\*])$/$1 /; print ".BI \" ".$type."\" ".$parameter." \""."\"\n;\n"; @@ -1169,6 +1170,7 @@ sub output_enum_text(%) { my $count; print "Enum:\n\n"; + print "enum ".$args{'enum'}." - ".$args{'purpose'}."\n\n"; print "enum ".$args{'enum'}." {\n"; $count = 0; foreach $parameter (@{$args{'parameterlist'}}) { @@ -1197,7 +1199,7 @@ sub output_typedef_text(%) { my $count; print "Typedef:\n\n"; - print "typedef ".$args{'typedef'}."\n"; + print "typedef ".$args{'typedef'}." - ".$args{'purpose'}."\n"; output_section_text(@_); } @@ -1206,7 +1208,7 @@ sub output_struct_text(%) { my %args = %{$_[0]}; my ($parameter); - print $args{'type'}." ".$args{'struct'}.":\n\n"; + print $args{'type'}." ".$args{'struct'}." - ".$args{'purpose'}."\n\n"; print $args{'type'}." ".$args{'struct'}." {\n"; foreach $parameter (@{$args{'parameterlist'}}) { if ($parameter =~ /^#/) {