X-Git-Url: http://ftp.safe.ca/?a=blobdiff_plain;f=scripts%2Fkernel-doc;h=a3e23b10ae976a34dba1b9c1e72e7e6c5a83db98;hb=3eb014a103701bedfaa11bc321f470e918c71ff7;hp=c47eb31d604c4469a355cb10c121849581b6ded3;hpb=3361c7bebbf207f57f3dd1282cd87e1e37c082ac;p=safe%2Fjmp%2Flinux-2.6 diff --git a/scripts/kernel-doc b/scripts/kernel-doc index c47eb31..a3e23b1 100755 --- a/scripts/kernel-doc +++ b/scripts/kernel-doc @@ -159,7 +159,8 @@ my $warnings = 0; my $type_constant = '\%([-_\w]+)'; my $type_func = '(\w+)\(\)'; my $type_param = '\@(\w+)'; -my $type_struct = '\&((struct\s*)?[_\w]+)'; +my $type_struct = '\&((struct\s*)*[_\w]+)'; +my $type_struct_xml = '\\\amp;((struct\s*)*[_\w]+)'; my $type_env = '(\$\w+)'; # Output conversion substitutions. @@ -168,7 +169,8 @@ my $type_env = '(\$\w+)'; # these work fairly well my %highlights_html = ( $type_constant, "\$1", $type_func, "\$1", - $type_struct, "\$1", + $type_struct_xml, "\$1", + $type_env, "\$1", $type_param, "\$1" ); my $blankline_html = "

"; @@ -331,7 +333,7 @@ while ($ARGV[0] =~ m/^-(.*)/) { # using the s// operator. my $dohighlight = ""; foreach my $pattern (keys %highlights) { -# print "scanning pattern $pattern ($highlights{$pattern})\n"; +# print STDERR "scanning pattern:$pattern, highlight:($highlights{$pattern})\n"; $dohighlight .= "\$contents =~ s:$pattern:$highlights{$pattern}:gs;\n"; } @@ -378,8 +380,14 @@ sub output_highlight { # confess "output_highlight got called with no args?\n"; # } +# print STDERR "contents b4:$contents\n"; eval $dohighlight; die $@ if $@; + if ($output_mode eq "html") { + $contents =~ s/\\\\//; + } +# print STDERR "contents af:$contents\n"; + foreach $line (split "\n", $contents) { if ($line eq ""){ print $lineprefix, $blankline; @@ -466,11 +474,12 @@ sub output_struct_html(%) { $type = $args{'parametertypes'}{$parameter}; if ($type =~ m/([^\(]*\(\*)\s*\)\s*\(([^\)]*)\)/) { # pointer-to-function - print " $1$parameter) ($2);
\n"; + print "    $1$parameter) ($2);
\n"; } elsif ($type =~ m/^(.*?)\s*(:.*)/) { - print " $1 $parameter$2;
\n"; + # bitfield + print "    $1 $parameter$2;
\n"; } else { - print " $type $parameter;
\n"; + print "    $type $parameter;
\n"; } } print "};
\n";