projects
/
powerpc.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch 'for-linus' of git://oss.sgi.com:8090/xfs/xfs-2.6
[powerpc.git]
/
scripts
/
kernel-doc
diff --git
a/scripts/kernel-doc
b/scripts/kernel-doc
index
a3e23b1
..
1f58351
100755
(executable)
--- a/
scripts/kernel-doc
+++ b/
scripts/kernel-doc
@@
-154,6
+154,7
@@
use strict;
my $errors = 0;
my $warnings = 0;
my $errors = 0;
my $warnings = 0;
+my $anon_struct_union = 0;
# match expressions used to find embedded type information
my $type_constant = '\%([-_\w]+)';
# match expressions used to find embedded type information
my $type_constant = '\%([-_\w]+)';
@@
-328,6
+329,16
@@
while ($ARGV[0] =~ m/^-(.*)/) {
}
}
}
}
+# get kernel version from env
+sub get_kernel_version() {
+ my $version;
+
+ if (defined($ENV{'KERNELVERSION'})) {
+ $version = $ENV{'KERNELVERSION'};
+ }
+ return $version;
+}
+my $kernelversion = get_kernel_version();
# generate a sequence of code that will splice in highlighting information
# using the s// operator.
# generate a sequence of code that will splice in highlighting information
# using the s// operator.
@@
-393,7
+404,11
@@
sub output_highlight {
print $lineprefix, $blankline;
} else {
$line =~ s/\\\\\\/\&/g;
print $lineprefix, $blankline;
} else {
$line =~ s/\\\\\\/\&/g;
- print $lineprefix, $line;
+ if ($output_mode eq "man" && substr($line, 0, 1) eq ".") {
+ print "\\&$line";
+ } else {
+ print $lineprefix, $line;
+ }
}
print "\n";
}
}
print "\n";
}
@@
-601,6
+616,7
@@
sub output_function_xml(%) {
print "<refmeta>\n";
print " <refentrytitle><phrase>".$args{'function'}."</phrase></refentrytitle>\n";
print " <manvolnum>9</manvolnum>\n";
print "<refmeta>\n";
print " <refentrytitle><phrase>".$args{'function'}."</phrase></refentrytitle>\n";
print " <manvolnum>9</manvolnum>\n";
+ print " <refmiscinfo class=\"version\">" . $kernelversion . "</refmiscinfo>\n";
print "</refmeta>\n";
print "<refnamediv>\n";
print " <refname>".$args{'function'}."</refname>\n";
print "</refmeta>\n";
print "<refnamediv>\n";
print " <refname>".$args{'function'}."</refname>\n";
@@
-677,6
+693,7
@@
sub output_struct_xml(%) {
print "<refmeta>\n";
print " <refentrytitle><phrase>".$args{'type'}." ".$args{'struct'}."</phrase></refentrytitle>\n";
print " <manvolnum>9</manvolnum>\n";
print "<refmeta>\n";
print " <refentrytitle><phrase>".$args{'type'}." ".$args{'struct'}."</phrase></refentrytitle>\n";
print " <manvolnum>9</manvolnum>\n";
+ print " <refmiscinfo class=\"version\">" . $kernelversion . "</refmiscinfo>\n";
print "</refmeta>\n";
print "<refnamediv>\n";
print " <refname>".$args{'type'}." ".$args{'struct'}."</refname>\n";
print "</refmeta>\n";
print "<refnamediv>\n";
print " <refname>".$args{'type'}." ".$args{'struct'}."</refname>\n";
@@
-706,6
+723,7
@@
sub output_struct_xml(%) {
# pointer-to-function
print " $1 $parameter) ($2);\n";
} elsif ($type =~ m/^(.*?)\s*(:.*)/) {
# pointer-to-function
print " $1 $parameter) ($2);\n";
} elsif ($type =~ m/^(.*?)\s*(:.*)/) {
+ # bitfield
print " $1 $parameter$2;\n";
} else {
print " ".$type." ".$parameter.";\n";
print " $1 $parameter$2;\n";
} else {
print " ".$type." ".$parameter.";\n";
@@
-761,6
+779,7
@@
sub output_enum_xml(%) {
print "<refmeta>\n";
print " <refentrytitle><phrase>enum ".$args{'enum'}."</phrase></refentrytitle>\n";
print " <manvolnum>9</manvolnum>\n";
print "<refmeta>\n";
print " <refentrytitle><phrase>enum ".$args{'enum'}."</phrase></refentrytitle>\n";
print " <manvolnum>9</manvolnum>\n";
+ print " <refmiscinfo class=\"version\">" . $kernelversion . "</refmiscinfo>\n";
print "</refmeta>\n";
print "<refnamediv>\n";
print " <refname>enum ".$args{'enum'}."</refname>\n";
print "</refmeta>\n";
print "<refnamediv>\n";
print " <refname>enum ".$args{'enum'}."</refname>\n";
@@
-1247,6
+1266,7
@@
sub output_struct_text(%) {
# pointer-to-function
print "\t$1 $parameter) ($2);\n";
} elsif ($type =~ m/^(.*?)\s*(:.*)/) {
# pointer-to-function
print "\t$1 $parameter) ($2);\n";
} elsif ($type =~ m/^(.*?)\s*(:.*)/) {
+ # bitfield
print "\t$1 $parameter$2;\n";
} else {
print "\t".$type." ".$parameter.";\n";
print "\t$1 $parameter$2;\n";
} else {
print "\t".$type." ".$parameter.";\n";
@@
-1497,8
+1517,13
@@
sub push_parameter($$$) {
my $param = shift;
my $type = shift;
my $file = shift;
my $param = shift;
my $type = shift;
my $file = shift;
- my $anon = 0;
+ if (($anon_struct_union == 1) && ($type eq "") &&
+ ($param eq "}")) {
+ return; # ignore the ending }; from anon. struct/union
+ }
+
+ $anon_struct_union = 0;
my $param_name = $param;
$param_name =~ s/\[.*//;
my $param_name = $param;
$param_name =~ s/\[.*//;
@@
-1517,16
+1542,16
@@
sub push_parameter($$$) {
# handle unnamed (anonymous) union or struct:
{
$type = $param;
# handle unnamed (anonymous) union or struct:
{
$type = $param;
- $param = "{unnamed_" . $param. "}";
+ $param = "{unnamed_" . $param
. "}";
$parameterdescs{$param} = "anonymous\n";
$parameterdescs{$param} = "anonymous\n";
- $anon = 1;
+ $anon
_struct_union
= 1;
}
# warn if parameter has no description
# (but ignore ones starting with # as these are not parameters
# but inline preprocessor statements);
# also ignore unnamed structs/unions;
}
# warn if parameter has no description
# (but ignore ones starting with # as these are not parameters
# but inline preprocessor statements);
# also ignore unnamed structs/unions;
- if (!$anon) {
+ if (!$anon
_struct_union
) {
if (!defined $parameterdescs{$param_name} && $param_name !~ /^#/) {
$parameterdescs{$param_name} = $undescribed;
if (!defined $parameterdescs{$param_name} && $param_name !~ /^#/) {
$parameterdescs{$param_name} = $undescribed;
@@
-1678,6
+1703,8
@@
sub process_state3_function($$) {
my $x = shift;
my $file = shift;
my $x = shift;
my $file = shift;
+ $x =~ s@\/\/.*$@@gos; # strip C99-style comments to end of line
+
if ($x =~ m#\s*/\*\s+MACDOC\s*#io || ($x =~ /^#/ && $x !~ /^#define/)) {
# do nothing
}
if ($x =~ m#\s*/\*\s+MACDOC\s*#io || ($x =~ /^#/ && $x !~ /^#define/)) {
# do nothing
}
@@
-1700,6
+1727,8
@@
sub process_state3_type($$) {
$x =~ s@[\r\n]+@ @gos; # strip newlines/cr's.
$x =~ s@^\s+@@gos; # strip leading spaces
$x =~ s@\s+$@@gos; # strip trailing spaces
$x =~ s@[\r\n]+@ @gos; # strip newlines/cr's.
$x =~ s@^\s+@@gos; # strip leading spaces
$x =~ s@\s+$@@gos; # strip trailing spaces
+ $x =~ s@\/\/.*$@@gos; # strip C99-style comments to end of line
+
if ($x =~ /^#/) {
# To distinguish preprocessor directive from regular declaration later.
$x .= ";";
if ($x =~ /^#/) {
# To distinguish preprocessor directive from regular declaration later.
$x .= ";";
@@
-1783,7
+1812,7
@@
sub process_file($) {
$state = 2;
if (/-(.*)/) {
$state = 2;
if (/-(.*)/) {
- # strip leading/trailing/multiple spaces
#RDD:T:
+ # strip leading/trailing/multiple spaces
$descr= $1;
$descr =~ s/^\s*//;
$descr =~ s/\s*$//;
$descr= $1;
$descr =~ s/^\s*//;
$descr =~ s/\s*$//;